Mercurial > hg > octave-nkf
diff scripts/plot/ylim.m @ 13096:5553412c6614
Tests for scripts/plot
* (allchild.m, ancestor.m, clf.m, findall.m, findobj.m, gcf.m,
line.m, view.m, whitebg.m, xlim.m, ylim.m, zlim.m): Add tests
author | Kai Habel <kai.habel@gmx.de> |
---|---|
date | Sun, 04 Sep 2011 21:58:42 +0200 |
parents | 0e231bbd78bc |
children | 2ea1658ad049 |
line wrap: on
line diff
--- a/scripts/plot/ylim.m +++ b/scripts/plot/ylim.m @@ -73,5 +73,24 @@ %! title ("ylim is auto"); %! assert (ylim ("mode"), "auto"); -## Remove from test statistics. No real tests possible. -%!assert (1) +%!test +%! hf = figure (1232, "visible", "off"); +%! unwind_protect +%! limy = [0, 1.1]; +%! plot3 ([0,1], [0,1], [0,1]); +%! ylim (limy); +%! assert (get (gca, "ylim"), limy, eps); +%! assert (ylim ("mode"), "manual"); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +%!test +%! hf = figure (1232, "visible", "off"); +%! unwind_protect +%! plot3 ([0,1], [0,1.1], [0, 1]); +%! assert (get (gca, "ylim"), [0, 1.4], eps); +%! assert (ylim ("mode"), "auto"); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect