Mercurial > hg > octave-lyh
diff scripts/plot/title.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 | 87015276d625 |
children | e81ddf9cacd5 |
line wrap: on
line diff
--- a/scripts/plot/title.m +++ b/scripts/plot/title.m @@ -52,5 +52,24 @@ %! title("Testing title") %! assert(get(xl,"string"),"Testing title") -## Remove from test statistics. No real tests possible. -%!assert (1) +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! ax=axes(); +%! xl = get(ax,"title"); +%! title("Testing title") +%! assert(get(xl,"string"),"Testing title") +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! plot3 ([0,1], [0,1], [0,1]); +%! xl = get(gca (), "title"); +%! title("Testing title") +%! assert(get(xl,"string"),"Testing title") +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect