Mercurial > hg > octave-lyh
comparison test/test_unwind.m @ 14131:c3309e1ec50d stable
test: Use Octave coding and spacing conventions for fixed test scripts
* build_bc_overload_tests.sh, build_bc_overloads_expected.m,
build_sparse_tests.sh, test_args.m, test_contin.m, test_diag_perm.m,
test_error.m, test_eval-catch.m, test_for.m, test_func.m, test_global.m,
test_if.m, test_index.m, test_io.m, test_logical_index.m, test_null_assign.m,
test_parser.m, test_prefer.m, test_range.m, test_recursion.m, test_return.m,
test_slice.m, test_struct.m, test_switch.m, test_system.m, test_transpose.m,
test_try.m, test_unwind.m, test_while.m:
Use Octave coding and spacing conventions for fixed test scripts.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 01 Jan 2012 20:04:52 -0800 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
14130:e13bfbc2c4c5 | 14131:c3309e1ec50d |
---|---|
28 %! y = [y, g]; | 28 %! y = [y, g]; |
29 %! unwind_protect_cleanup | 29 %! unwind_protect_cleanup |
30 %! g = save_g; | 30 %! g = save_g; |
31 %! y = [y, g]; | 31 %! y = [y, g]; |
32 %! end_unwind_protect | 32 %! end_unwind_protect |
33 %!endfunction | |
34 %! | |
33 %!test | 35 %!test |
34 %! global g = -1; | 36 %! global g = -1; |
35 %! y = f ([3,4]); | 37 %! y = f ([3,4]); |
36 %! assert(y,[0,1,-1]); | 38 %! assert (y, [0,1,-1]); |
37 | 39 |
38 %% test/octave.test/unwind/unwind-2.m | 40 %% test/octave.test/unwind/unwind-2.m |
39 %!function y = f (x) | 41 %!function y = f (x) |
40 %! global g; | 42 %! global g; |
41 %! save_g = g; | 43 %! save_g = g; |
46 %! g = 1; | 48 %! g = 1; |
47 %! y = [y, g]; | 49 %! y = [y, g]; |
48 %! unwind_protect_cleanup | 50 %! unwind_protect_cleanup |
49 %! g = save_g; | 51 %! g = save_g; |
50 %! y = [y, g]; | 52 %! y = [y, g]; |
51 %! assert(y,[0,-1]); | 53 %! assert (y, [0,-1]); |
52 %! end_unwind_protect | 54 %! end_unwind_protect |
55 %!endfunction | |
56 %! | |
53 %!test | 57 %!test |
54 %! global g = -1; | 58 %! global g = -1; |
55 %! fail("y = f (3);","mismatch"); | 59 %! fail ("y = f (3);", "mismatch"); |
56 | 60 |