diff scripts/plot/findobj.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 c792872f8942
children ebb42fb2da04
line wrap: on
line diff
--- a/scripts/plot/findobj.m
+++ b/scripts/plot/findobj.m
@@ -242,3 +242,18 @@
   h = h (keepers != 0);
   h = reshape (h, [numel(h), 1]);
 endfunction
+
+%!test
+%! fign = 1232;
+%! hf = figure (fign, "visible", "off");
+%! unwind_protect  
+%!   l = line;
+%!   obj = findobj ("type", "line");
+%!   assert (l, obj);
+%!   assert (gca, findobj ("type", "axes"));
+%!   assert (fign, findobj ("type", "figure"));
+%!   assert (0, findobj ("type", "root"));
+%!   assert (isempty (findobj ("type", "xyzxyz")));
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect