Mercurial > hg > octave-terminal
changeset 13129:155d7a5e70f5
src/pr-output.cc: Test "format compact"
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sun, 11 Sep 2011 14:18:20 -0400 |
parents | e39c76eb5fbd |
children | d7f74a8bdc46 |
files | src/pr-output.cc |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -3547,6 +3547,21 @@ %! endfor %! endfor %! fclose (fd); + +%!test +%! foo.real = pi * ones (3,20,3); +%! foo.complex = pi * ones (3,20,3) + 1i; +%! foo.char = repmat ("- Hello World -", [3, 20]); +%! foo.cell = {foo.real, foo.complex, foo.char}; +%! fields = fieldnames (foo); +%! for f = 1:numel(fields) +%! format loose +%! loose = disp (foo.(fields{f})); +%! format compact +%! compact = disp (foo.(fields{f})); +%! expected = strrep (loose, "\n\n", "\n"); +%! assert (expected, compact) +%! endfor */ static void