Mercurial > hg > octave-lojdl
changeset 14084:5aba9fa234cf stable
Modernize %!tests for eval()
* oct-parse.yy (eval): Modernize %!tests for eval()
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 21 Dec 2011 09:12:59 -0800 |
parents | 8717cc808b20 |
children | 4e8f23ccadce |
files | src/oct-parse.yy |
diffstat | 1 files changed, 22 insertions(+), 72 deletions(-) [+] |
line wrap: on
line diff
--- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -4518,84 +4518,34 @@ /* -%% test/octave.test/eval/eval-1.m -%!#test +%!shared x %! x = 1; -%! assert(eval ("x"),1); - -%% test/octave.test/eval/eval-2.m -%!test -%! x = 1; -%! assert(eval ("x;")); - -%% test/octave.test/eval/eval-3.m + +%!assert (eval ("x"), 1) +%!assert (eval ("x;")) +%!assert (eval ("x;"), 1); + %!test -%! x = 1; -%! assert(eval ("x;"),1); - -%% FIXME -%% Disable this test as adding the ";" is redundant with eval-1 and -%% in any case is a syntax error with assert -%% test/octave.test/eval/eval-4.m -%!#test -%! x = 1; -%! assert(eval ("x");,1); - -%% test/octave.test/eval/eval-5.m +%! y = eval ("x"); +%! assert (y, 1); + +%!test +%! y = eval ("x;"); +%! assert (y, 1); + +%!test +%! eval ("x = 1;") +%! assert (x,1); + %!test %! eval ("flipud = 2;"); -%! assert(flipud,2); - -%% test/octave.test/eval/eval-6.m -%!function y = f () +%! assert (flipud, 2); + +%!function y = __f () %! eval ("flipud = 2;"); %! y = flipud; -%!test -%! assert(f,2); - -%% test/octave.test/eval/eval-7.m -%!#test -%! eval ("x = 1"); -%! assert(x,1); - -%% test/octave.test/eval/eval-8.m -%!test -%! eval ("x = 1;") -%! assert(x,1); - -%% test/octave.test/eval/eval-9.m -%!test -%! eval ("x = 1;"); -%! assert(x,1); - -%% test/octave.test/eval/eval-10.m -%!#test -%! eval ("x = 1") -%! assert(x,1); - -%% test/octave.test/eval/eval-11.m -%!test -%! x = 1; -%! y = eval ("x"); -%! assert(y,1); - -%% test/octave.test/eval/eval-12.m -%!test -%! x = 1; -%! y = eval ("x;"); -%! assert(y,1); - -%% test/octave.test/eval/eval-13.m -%!test -%! x = 1; -%! y = eval ("x;"); -%! assert(y,1); - -%% test/octave.test/eval/eval-14.m -%!test -%! x = 1; -%! y = eval ("x"); -%! assert(y,1); +%!endfunction +%!assert (__f(), 2) */