Mercurial > octave
comparison src/oct-parse.yy @ 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 | c93b953f7d54 |
children | 72c96de7a403 4942b3011541 |
comparison
equal
deleted
inserted
replaced
14083:8717cc808b20 | 14084:5aba9fa234cf |
---|---|
4516 return retval; | 4516 return retval; |
4517 } | 4517 } |
4518 | 4518 |
4519 /* | 4519 /* |
4520 | 4520 |
4521 %% test/octave.test/eval/eval-1.m | 4521 %!shared x |
4522 %!#test | |
4523 %! x = 1; | 4522 %! x = 1; |
4524 %! assert(eval ("x"),1); | 4523 |
4525 | 4524 %!assert (eval ("x"), 1) |
4526 %% test/octave.test/eval/eval-2.m | 4525 %!assert (eval ("x;")) |
4526 %!assert (eval ("x;"), 1); | |
4527 | |
4527 %!test | 4528 %!test |
4528 %! x = 1; | 4529 %! y = eval ("x"); |
4529 %! assert(eval ("x;")); | 4530 %! assert (y, 1); |
4530 | 4531 |
4531 %% test/octave.test/eval/eval-3.m | |
4532 %!test | 4532 %!test |
4533 %! x = 1; | 4533 %! y = eval ("x;"); |
4534 %! assert(eval ("x;"),1); | 4534 %! assert (y, 1); |
4535 | 4535 |
4536 %% FIXME | 4536 %!test |
4537 %% Disable this test as adding the ";" is redundant with eval-1 and | 4537 %! eval ("x = 1;") |
4538 %% in any case is a syntax error with assert | 4538 %! assert (x,1); |
4539 %% test/octave.test/eval/eval-4.m | 4539 |
4540 %!#test | |
4541 %! x = 1; | |
4542 %! assert(eval ("x");,1); | |
4543 | |
4544 %% test/octave.test/eval/eval-5.m | |
4545 %!test | 4540 %!test |
4546 %! eval ("flipud = 2;"); | 4541 %! eval ("flipud = 2;"); |
4547 %! assert(flipud,2); | 4542 %! assert (flipud, 2); |
4548 | 4543 |
4549 %% test/octave.test/eval/eval-6.m | 4544 %!function y = __f () |
4550 %!function y = f () | |
4551 %! eval ("flipud = 2;"); | 4545 %! eval ("flipud = 2;"); |
4552 %! y = flipud; | 4546 %! y = flipud; |
4553 %!test | 4547 %!endfunction |
4554 %! assert(f,2); | 4548 %!assert (__f(), 2) |
4555 | |
4556 %% test/octave.test/eval/eval-7.m | |
4557 %!#test | |
4558 %! eval ("x = 1"); | |
4559 %! assert(x,1); | |
4560 | |
4561 %% test/octave.test/eval/eval-8.m | |
4562 %!test | |
4563 %! eval ("x = 1;") | |
4564 %! assert(x,1); | |
4565 | |
4566 %% test/octave.test/eval/eval-9.m | |
4567 %!test | |
4568 %! eval ("x = 1;"); | |
4569 %! assert(x,1); | |
4570 | |
4571 %% test/octave.test/eval/eval-10.m | |
4572 %!#test | |
4573 %! eval ("x = 1") | |
4574 %! assert(x,1); | |
4575 | |
4576 %% test/octave.test/eval/eval-11.m | |
4577 %!test | |
4578 %! x = 1; | |
4579 %! y = eval ("x"); | |
4580 %! assert(y,1); | |
4581 | |
4582 %% test/octave.test/eval/eval-12.m | |
4583 %!test | |
4584 %! x = 1; | |
4585 %! y = eval ("x;"); | |
4586 %! assert(y,1); | |
4587 | |
4588 %% test/octave.test/eval/eval-13.m | |
4589 %!test | |
4590 %! x = 1; | |
4591 %! y = eval ("x;"); | |
4592 %! assert(y,1); | |
4593 | |
4594 %% test/octave.test/eval/eval-14.m | |
4595 %!test | |
4596 %! x = 1; | |
4597 %! y = eval ("x"); | |
4598 %! assert(y,1); | |
4599 | 4549 |
4600 */ | 4550 */ |
4601 | 4551 |
4602 DEFUN (assignin, args, , | 4552 DEFUN (assignin, args, , |
4603 "-*- texinfo -*-\n\ | 4553 "-*- texinfo -*-\n\ |