Mercurial > hg > octave-lyh
diff scripts/plot/ishghandle.m @ 13136:79b9a7669bb8
Tests added for scripts/plot
(plot/ishghandle.m, plot/text.m, plot/title.m, plot/xlabel.m, plot/ylabel.m,
plot/zlabel.m): Tests added for plot functions.
plot/whitebg.m: Fix typo. Change colors only for figure under test
author | Kai Habel <kai.habel@gmx.de> |
---|---|
date | Wed, 14 Sep 2011 21:03:39 +0200 |
parents | c792872f8942 |
children | e81ddf9cacd5 |
line wrap: on
line diff
--- a/scripts/plot/ishghandle.m +++ b/scripts/plot/ishghandle.m @@ -26,3 +26,34 @@ ## no simulink equivalent. retval = ishandle (h); endfunction + +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! assert (ishghandle (hf)); +%! assert (!ishghandle (-hf)); +%! l = line; +%! ax = gca(); +%! assert (ishghandle (ax)); +%! assert (!ishghandle (-ax)); +%! assert (ishghandle (l)); +%! assert (!ishghandle (-l)); +%! p = patch; +%! assert (ishghandle (p)); +%! assert (!ishghandle (-p)); +%! s = surface; +%! assert (ishghandle (s)); +%! assert (!ishghandle (-s)); +%! t = text; +%! assert (ishghandle (t)); +%! assert (!ishghandle (-t)); +%! i = image; +%! assert (ishghandle (i)); +%! assert (!ishghandle (-i)); +%! hg = hggroup; +%! assert (ishghandle (hg)); +%! assert (!ishghandle (-hg)); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect +