Mercurial > octave-nkf
comparison test/switch.tst @ 17309:5a65b2cc9508
test: Add tests for 'end' form of 'endfor', 'endif', etc.
* test/for.tst, test/if.tst, test/jit.tst, test/switch.tst, test/try.tst,
test/unwind.tst, test/while.tst: Add tests for 'end' form of 'endfor', 'endif',
etc.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 21 Aug 2013 18:06:25 -0700 |
parents | c3c1ebfaa7dc |
children | d63878346099 |
comparison
equal
deleted
inserted
replaced
17308:5a6caf617f56 | 17309:5a65b2cc9508 |
---|---|
19 %!test | 19 %!test |
20 %! a = 1; | 20 %! a = 1; |
21 %! b = 2; | 21 %! b = 2; |
22 %! c = 3; | 22 %! c = 3; |
23 %! | 23 %! |
24 %! switch (0) case 1 x = a; case 2 x = b; otherwise x = c; endswitch | 24 %! ## "end" is part of test, check not using "endswitch" |
25 %! switch (0) case 1 x = a; case 2 x = b; otherwise x = c; end | |
25 %! switch (1) case 1 y = a; case 2 y = b; otherwise y = c; endswitch | 26 %! switch (1) case 1 y = a; case 2 y = b; otherwise y = c; endswitch |
26 %! switch (2) case 1 z = a; case 2 z = b; otherwise z = c; endswitch | 27 %! switch (2) case 1 z = a; case 2 z = b; otherwise z = c; endswitch |
27 %! switch (3) case 1 p = a; case 2 p = b; otherwise p = c; endswitch | 28 %! switch (3) case 1 p = a; case 2 p = b; otherwise p = c; endswitch |
28 %! | 29 %! |
29 %! assert (x == c && y == a && z == b && p == c); | 30 %! assert (x == c && y == a && z == b && p == c); |