Mercurial > octave-nkf
diff test/test_parser.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 | 1bfca2bbea8b |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/test/test_parser.m Sun Jan 01 19:17:02 2012 -0500 +++ b/test/test_parser.m Sun Jan 01 20:04:52 2012 -0800 @@ -16,8 +16,8 @@ ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. -## Tests for parser problems belong in this file. We need many more -## tests here! +## Tests for parser problems belong in this file. +## We need many more tests here! %!assert ({1 2 {3 4}}, {1,2,{3,4}}) %!assert ({1, 2 {3 4}}, {1,2,{3,4}}) @@ -247,6 +247,8 @@ %! assert (a += b *= c += 1, 42) %! assert (b == 40 && c == 8) +## Test creation of anonymous functions + %!test %! af_in_cell = {@(x) [1 2]}; %! assert (af_in_cell{1}(), [1, 2]); @@ -254,3 +256,4 @@ %!test %! R = @(rot) [cos(rot) -sin(rot); sin(rot) cos(rot)]; %! assert (R(pi/2), [cos(pi/2), -sin(pi/2); sin(pi/2),cos(pi/2)]); +