# HG changeset patch # User Rik # Date 1459559761 25200 # Node ID 6fab85c1538f0fdb02df7eacab99890b75b79e4b # Parent ecce63c99c3fe81cf7007c0cef6ca49a59cd3a05 maint: Follow Octave conventions for use of semicolon in BIST tests. * testfun.txi: Document Octave conventions for use of semicolon in BIST tests. * cellfun.cc, ellipj.cc, file-io.cc, gcd.cc, hash.cc, nproc.cc, utils.cc, fftw.cc, ov-usr-fcn.cc, oct-parse.in.yy, md5sum.m, wavread.m, wavwrite.m, cplxpair.m, rat.m, im2double.m, rref.m, stem3.m, rotate.m, pchip.m, blackman.m, hamming.m, hanning.m, spectral_adf.m, spectral_xdf.m, assert.m, fail.m, etime.m, build-sparse-tests.sh, classes.tst, ctor-vs-method.tst, index.tst, io.tst, struct.tst: Follow Octave conventions for use of semicolon in BIST tests. diff -r ecce63c99c3f -r 6fab85c1538f doc/interpreter/testfun.txi --- a/doc/interpreter/testfun.txi Fri Apr 01 16:03:29 2016 -0700 +++ b/doc/interpreter/testfun.txi Fri Apr 01 18:16:01 2016 -0700 @@ -50,8 +50,8 @@ @example @group -%!test error ("this test fails!"); -%!test "test doesn't fail. it doesn't generate an error"; +%!test error ("this test fails!") +%!test "test doesn't fail. it doesn't generate an error" @end group @end example @@ -99,8 +99,8 @@ @example @group -%!test assert (1+eps, 1, 2*eps) # absolute error -%!test assert (100+100*eps, 100, -2*eps) # relative error +%!test assert (1+eps, 1, 2*eps) # absolute error +%!test assert (100+100*eps, 100, -2*eps) # relative error @end group @end example @@ -225,13 +225,13 @@ For example: @example -%!error error ("this test passes!"); +%!error error ("this test passes!") @end example If the code doesn't generate an error, the test fails. For example: @example -%!error "this is an error because it succeeds."; +%!error "this is an error because it succeeds." @end example @noindent @@ -239,7 +239,7 @@ @example @group - ***** error "this is an error because it succeeds."; + ***** error "this is an error because it succeeds." !!!!! test failed: no error @end group @end example @@ -291,7 +291,7 @@ @noindent The following trivial code snippet provides examples for the use of -fail, assert, error and xtest: +fail, assert, error, and xtest: @example @group @@ -363,8 +363,35 @@ @item %!assert (x, y, tol) shorthand for @code{%!test assert (x, y, tol)} + +@item %!fail (CODE, PATTERN) +shorthand for @code{%!test fail (CODE, PATTERN)} + @end table +When coding tests the Octave convention is that lines that begin with a block +type do not have a semicolon at the end. Any code that is within a block, +however, is normal Octave code and usually will have a trailing semicolon. +For example, + +@example +@group +## bare block instantiation +%!assert (sin (0), 0) +@end group +@end example + +@noindent +but + +@example +@group +## test block with normal Octave code +%!test +%! assert (sin (0), 0); +@end group +@end example + You can also create test scripts for built-in functions and your own C++ functions. To do so, put a file with the bare function name (no .m extension) in a directory in the load path and it will be discovered by diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/cellfun.cc Fri Apr 01 18:16:01 2016 -0700 @@ -706,7 +706,7 @@ %! cellfun (@__f01, {1}); %! assert (__cellfun_test_num_outputs__, 0); -%!error x = cellfun (@__f01, {1, 2}); +%!error x = cellfun (@__f01, {1, 2}) %!test %! assert (cellfun (@__f11, {1, 2}), [1, 2]); @@ -1405,7 +1405,7 @@ %! arrayfun (@__f01, {1}); %! assert (__arrayfun_test_num_outputs__, 0); -%!error x = arrayfun (@__f01, [1, 2]); +%!error x = arrayfun (@__f01, [1, 2]) %!test %! assert (arrayfun (@__f11, [1, 2]), [1, 2]); diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/ellipj.cc --- a/libinterp/corefcn/ellipj.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/ellipj.cc Fri Apr 01 18:16:01 2016 -0700 @@ -831,7 +831,7 @@ %!error ellipj (1) %!error ellipj (1,2,3,4) %!warning ellipj (1,2); -## FIXME: errors commented out untill lasterr() truly returns the last error. +## FIXME: errors commented out until lasterr() truly returns the last error. %!#error ellipj (1, "1") %!#error ellipj ("1", 1) %!#error ellipj ({1}, 1) diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/file-io.cc Fri Apr 01 18:16:01 2016 -0700 @@ -1718,7 +1718,7 @@ %! assert (c, {[1;4], 2, 3}); %! assert (u, {[1;4], 2, 3}); -%!error textscan ("1 2 3\n4 s 6", "%f %f %f", "ReturnOnError", 0); +%!error textscan ("1 2 3\n4 s 6", "%f %f %f", "ReturnOnError", 0) %!test %! ## Check ReturnOnError @@ -1757,8 +1757,8 @@ %!error textscan ("Hello World", 2) #%!error [C, pos] = textscan ("Hello World") %!error textscan ("Hello World", '%s', 'EndOfLine', 3) -%!error <'%z' is not a valid format specifier> textscan ("1.0", "%z"); -%!error textscan ("1.0", "foo"); +%!error <'%z' is not a valid format specifier> textscan ("1.0", "%z") +%!error textscan ("1.0", "foo") ## Test incomplete first data line %! R = textscan (['Empty1' char(10)], 'Empty%d %f'); diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/gcd.cc --- a/libinterp/corefcn/gcd.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/gcd.cc Fri Apr 01 18:16:01 2016 -0700 @@ -520,8 +520,8 @@ %! assert (abs (z), sqrt (2)); %! assert (abs (sum (u.*w)), sqrt (2)); -%!error gcd (1/2, 2); -%!error gcd (e + i*pi, 1); +%!error gcd (1/2, 2) +%!error gcd (e + i*pi, 1) %!error gcd () diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/hash.cc --- a/libinterp/corefcn/hash.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/hash.cc Fri Apr 01 18:16:01 2016 -0700 @@ -287,14 +287,14 @@ %! unlink (tfile); ## Test bad function calls -%!error hash (); -%!error hash (""); -%!error hash ("", ""); -%!error hash ("", "", ""); -%!error hash (1, ""); -%!error hash ([1, 0; 0, 1], ""); -%!error hash ("unknown", ""); -%!error hash ("md5"); -%!error hash ("sha1"); -%!error hash ("sha512"); +%!error hash () +%!error hash ("") +%!error hash ("", "") +%!error hash ("", "", "") +%!error hash (1, "") +%!error hash ([1, 0; 0, 1], "") +%!error hash ("unknown", "") +%!error hash ("md5") +%!error hash ("sha1") +%!error hash ("sha512") */ diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/nproc.cc --- a/libinterp/corefcn/nproc.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/nproc.cc Fri Apr 01 18:16:01 2016 -0700 @@ -95,5 +95,5 @@ %! endif %! end_unwind_protect -%!error nproc ("no_valid_option"); +%!error nproc ("no_valid_option") */ diff -r ecce63c99c3f -r 6fab85c1538f libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/corefcn/utils.cc Fri Apr 01 18:16:01 2016 -0700 @@ -124,7 +124,7 @@ %!assert (isvarname ("foo+bar"), false) %!error isvarname () -%!error isvarname ("foo", "bar"); +%!error isvarname ("foo", "bar") */ // Return TRUE if F and G are both names for the same file. diff -r ecce63c99c3f -r 6fab85c1538f libinterp/dldfcn/fftw.cc --- a/libinterp/dldfcn/fftw.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/dldfcn/fftw.cc Fri Apr 01 18:16:01 2016 -0700 @@ -368,14 +368,14 @@ %! fftw ("threads", n); %! end_unwind_protect -%!error fftw (); -%!error fftw ("planner", "estimate", "measure"); -%!error fftw (3); -%!error fftw ("invalid"); -%!error fftw ("planner", "invalid"); -%!error fftw ("planner", 2); -%!error fftw ("dwisdom", "invalid"); -%!error fftw ("swisdom", "invalid"); -%!error fftw ("threads", "invalid"); -%!error fftw ("threads", -3); +%!error fftw () +%!error fftw ("planner", "estimate", "measure") +%!error fftw (3) +%!error fftw ("invalid") +%!error fftw ("planner", "invalid") +%!error fftw ("planner", 2) +%!error fftw ("dwisdom", "invalid") +%!error fftw ("swisdom", "invalid") +%!error fftw ("threads", "invalid") +%!error fftw ("threads", -3) */ diff -r ecce63c99c3f -r 6fab85c1538f libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/octave-value/ov-usr-fcn.cc Fri Apr 01 18:16:01 2016 -0700 @@ -1107,7 +1107,7 @@ %! [~, y] = try_isargout (); %! assert (y, -2); %! -%!error [~, ~] = try_isargout (); +%!error [~, ~] = try_isargout () %! %% Check to see that isargout isn't sticky: %!test diff -r ecce63c99c3f -r 6fab85c1538f libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Fri Apr 01 16:03:29 2016 -0700 +++ b/libinterp/parse-tree/oct-parse.in.yy Fri Apr 01 18:16:01 2016 -0700 @@ -5119,7 +5119,7 @@ %! [a,] = gcd (1,2); %! [a,b,] = gcd (1, 2); -%!error eval ("switch = 13;"); +%!error eval ("switch = 13;") */ @@ -5170,7 +5170,7 @@ /* -%!error assignin ("base", "switch", "13"); +%!error assignin ("base", "switch", "13") */ @@ -5390,7 +5390,7 @@ %! warning ("off", "quiet", "local"); %! assert (evalc ("error ('foo')", "warning ('bar')"), "warning: bar\n"); -%!error evalc ("switch = 13;"); +%!error evalc ("switch = 13;") */ diff -r ecce63c99c3f -r 6fab85c1538f scripts/deprecated/md5sum.m --- a/scripts/deprecated/md5sum.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/deprecated/md5sum.m Fri Apr 01 18:16:01 2016 -0700 @@ -71,4 +71,4 @@ %! assert (md5sum (tfile), "147a664a2ca9410911e61986d3f0d52a"); %! unlink (tfile); -%!error md5sum (); +%!error md5sum () diff -r ecce63c99c3f -r 6fab85c1538f scripts/deprecated/wavread.m --- a/scripts/deprecated/wavread.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/deprecated/wavread.m Fri Apr 01 18:16:01 2016 -0700 @@ -125,5 +125,5 @@ %!error wavread ("foo.wav", 2, 3, 4) %!error wavread ("foo.wav", "foo") %!error wavread ("foo.wav", -1) -%!error wavread ("foo.wav", [1, Inf], "foo"); +%!error wavread ("foo.wav", [1, Inf], "foo") diff -r ecce63c99c3f -r 6fab85c1538f scripts/deprecated/wavwrite.m --- a/scripts/deprecated/wavwrite.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/deprecated/wavwrite.m Fri Apr 01 18:16:01 2016 -0700 @@ -190,5 +190,5 @@ %!error wavwrite () %!error wavwrite (1) %!error wavwrite (1,2,3,4,5) -%!error wavwrite ([], "foo.wav"); +%!error wavwrite ([], "foo.wav") diff -r ecce63c99c3f -r 6fab85c1538f scripts/general/cplxpair.m --- a/scripts/general/cplxpair.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/general/cplxpair.m Fri Apr 01 18:16:01 2016 -0700 @@ -156,9 +156,9 @@ ## Test tolerance %!assert (cplxpair ([2000 * (1+eps) + 4j; 2000 * (1-eps) - 4j]), ... %! [(2000 - 4j); (2000 + 4j)], 100*eps(200)) -%!error cplxpair ([2000 * (1+eps) + 4j; 2000 * (1-eps) - 4j], 0); +%!error cplxpair ([2000 * (1+eps) + 4j; 2000 * (1-eps) - 4j], 0) -%!error cplxpair ([2e6 + j; 2e6 - j; 1e-9 * (1 + j); 1e-9 * (1 - 2j)]); +%!error cplxpair ([2e6 + j; 2e6 - j; 1e-9 * (1 + j); 1e-9 * (1 - 2j)]) ## Test input validation %!error cplxpair () diff -r ecce63c99c3f -r 6fab85c1538f scripts/general/rat.m --- a/scripts/general/rat.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/general/rat.m Fri Apr 01 18:16:01 2016 -0700 @@ -162,6 +162,6 @@ ## bug #43374 %!assert (eval (rat (0.75)), [0.75]) -%!error rat (); -%!error rat (1, 2, 3); +%!error rat () +%!error rat (1, 2, 3) diff -r ecce63c99c3f -r 6fab85c1538f scripts/image/im2double.m --- a/scripts/image/im2double.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/image/im2double.m Fri Apr 01 18:16:01 2016 -0700 @@ -126,6 +126,6 @@ %!assert (im2double ([0 -1.5 -2i], "indexed"), [0 -1.5 -2i]) %!assert (im2double ([false true], "indexed"), [0 1]) -%!error im2double (int16 ([17 8]), "indexed"); -%!error im2double (int16 ([-7 8]), "indexed"); -%!error im2double ([1 2 3], "non-indexed"); +%!error im2double (int16 ([17 8]), "indexed") +%!error im2double (int16 ([-7 8]), "indexed") +%!error im2double ([1 2 3], "non-indexed") diff -r ecce63c99c3f -r 6fab85c1538f scripts/linear-algebra/rref.m --- a/scripts/linear-algebra/rref.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/linear-algebra/rref.m Fri Apr 01 18:16:01 2016 -0700 @@ -126,5 +126,5 @@ %! [r k] = rref (a, tol); %! assert (rank (a, tol), rank (r, tol), 2e-8); -%!error rref (); +%!error rref () diff -r ecce63c99c3f -r 6fab85c1538f scripts/plot/draw/stem3.m --- a/scripts/plot/draw/stem3.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/plot/draw/stem3.m Fri Apr 01 18:16:01 2016 -0700 @@ -87,7 +87,7 @@ %!error stem3 ({1}, 1, 1) %!error stem3 (1, {1}, 1) %!error stem3 (1, 1, {1}) -%!error stem3 (ones (2,2), 1, 1); -%!error stem3 (1, ones (2,2), 1); -%!error stem3 (1, 1, ones (2,2)); +%!error stem3 (ones (2,2), 1, 1) +%!error stem3 (1, ones (2,2), 1) +%!error stem3 (1, 1, ones (2,2)) %!error stem3 (1, "FOO") diff -r ecce63c99c3f -r 6fab85c1538f scripts/plot/util/rotate.m --- a/scripts/plot/util/rotate.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/plot/util/rotate.m Fri Apr 01 18:16:01 2016 -0700 @@ -175,14 +175,14 @@ %! o3 = text (0, 0, "foobar"); %!error rotate () %!error rotate (o1) -%!error rotate (o1, [0,0,0]); -%!error rotate ([o1, o2], [0,0,0], 90); -%!error rotate (o1, "foo", 90); -%!error rotate (o1, [0,0,0], "foo"); -%!error rotate (o1, [0,0,0], 90, "foo"); -%!error rotate (o1, [0,0,0], 90, [0,0,0], 1); -%!error rotate (NaN, [0,0,0], 90); -%!error rotate (o3, [0,0,0], 90); +%!error rotate (o1, [0,0,0]) +%!error rotate ([o1, o2], [0,0,0], 90) +%!error rotate (o1, "foo", 90) +%!error rotate (o1, [0,0,0], "foo") +%!error rotate (o1, [0,0,0], 90, "foo") +%!error rotate (o1, [0,0,0], 90, [0,0,0], 1) +%!error rotate (NaN, [0,0,0], 90) +%!error rotate (o3, [0,0,0], 90) %!test %! close (h1); %! close (h2); diff -r ecce63c99c3f -r 6fab85c1538f scripts/polynomial/pchip.m --- a/scripts/polynomial/pchip.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/polynomial/pchip.m Fri Apr 01 18:16:01 2016 -0700 @@ -172,6 +172,6 @@ %!assert (size (yi2), [3,2,5,4]) %!assert (squeeze (yi2(1,2,3,:)), [1/sqrt(2); 0; -1/sqrt(2);-1], 1e-14) -%!error (pchip (1,2)); -%!error (pchip (1,2,3)); +%!error (pchip (1,2)) +%!error (pchip (1,2,3)) diff -r ecce63c99c3f -r 6fab85c1538f scripts/signal/blackman.m --- a/scripts/signal/blackman.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/signal/blackman.m Fri Apr 01 18:16:01 2016 -0700 @@ -89,5 +89,5 @@ %!error blackman (0.5) %!error blackman (-1) %!error blackman (ones (1,4)) -%!error blackman (1, "invalid"); +%!error blackman (1, "invalid") diff -r ecce63c99c3f -r 6fab85c1538f scripts/signal/hamming.m --- a/scripts/signal/hamming.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/signal/hamming.m Fri Apr 01 18:16:01 2016 -0700 @@ -87,5 +87,5 @@ %!error hamming (0.5) %!error hamming (-1) %!error hamming (ones (1,4)) -%!error hamming (1, "invalid"); +%!error hamming (1, "invalid") diff -r ecce63c99c3f -r 6fab85c1538f scripts/signal/hanning.m --- a/scripts/signal/hanning.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/signal/hanning.m Fri Apr 01 18:16:01 2016 -0700 @@ -87,5 +87,5 @@ %!error hanning (0.5) %!error hanning (-1) %!error hanning (ones (1,4)) -%!error hanning (1, "invalid"); +%!error hanning (1, "invalid") diff -r ecce63c99c3f -r 6fab85c1538f scripts/signal/spectral_adf.m --- a/scripts/signal/spectral_adf.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/signal/spectral_adf.m Fri Apr 01 18:16:01 2016 -0700 @@ -70,8 +70,8 @@ ## Test input validation -%!error spectral_adf (); -%!error spectral_adf (1, 2, 3, 4); -%!error spectral_adf (1, 2); -%!error spectral_adf (1, "invalid"); +%!error spectral_adf () +%!error spectral_adf (1, 2, 3, 4) +%!error spectral_adf (1, 2) +%!error spectral_adf (1, "invalid") diff -r ecce63c99c3f -r 6fab85c1538f scripts/signal/spectral_xdf.m --- a/scripts/signal/spectral_xdf.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/signal/spectral_xdf.m Fri Apr 01 18:16:01 2016 -0700 @@ -72,8 +72,8 @@ ## Test input validation -%!error spectral_xdf (); -%!error spectral_xdf (1, 2, 3, 4); -%!error spectral_xdf (1, 2); -%!error spectral_xdf (1, "invalid"); +%!error spectral_xdf () +%!error spectral_xdf (1, 2, 3, 4) +%!error spectral_xdf (1, 2) +%!error spectral_xdf (1, "invalid") diff -r ecce63c99c3f -r 6fab85c1538f scripts/testfun/assert.m --- a/scripts/testfun/assert.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/testfun/assert.m Fri Apr 01 18:16:01 2016 -0700 @@ -449,15 +449,15 @@ ## vectors %!assert ([1,2,3],[1,2,3]) %!assert ([1;2;3],[1;2;3]) -%!error assert ([2,2,3,3],[1,2,3,4]); -%!error assert ([2,2,3,3],[1,2,3,4],0.5); -%!error assert ([2,2,3,5],[1,2,3,4],-0.1); -%!error assert ([6;6;7;7],[5;6;7;8]); -%!error assert ([6;6;7;7],[5;6;7;8],0.5); -%!error assert ([6;6;7;7],[5;6;7;8],-0.1); -%!error assert ([1,2,3],[1;2;3]); -%!error assert ([1,2],[1,2,3]); -%!error assert ([1;2;3],[1;2]); +%!error assert ([2,2,3,3],[1,2,3,4]) +%!error assert ([2,2,3,3],[1,2,3,4],0.5) +%!error assert ([2,2,3,5],[1,2,3,4],-0.1) +%!error assert ([6;6;7;7],[5;6;7;8]) +%!error assert ([6;6;7;7],[5;6;7;8],0.5) +%!error assert ([6;6;7;7],[5;6;7;8],-0.1) +%!error assert ([1,2,3],[1;2;3]) +%!error assert ([1,2],[1,2,3]) +%!error assert ([1;2;3],[1;2]) ## matrices %!assert ([1,2;3,4],[1,2;3,4]) @@ -481,9 +481,9 @@ ## test relative vs. absolute tolerances %!test assert (0.1+eps, 0.1, 2*eps); -%!error assert (0.1+eps, 0.1, -2*eps); +%!error assert (0.1+eps, 0.1, -2*eps) %!test assert (100+100*eps, 100, -2*eps); -%!error assert (100+100*eps, 100, 2*eps); +%!error assert (100+100*eps, 100, 2*eps) ## Corner case of relative tolerance with 0 divider %!error assert (2, 0, -0.1) diff -r ecce63c99c3f -r 6fab85c1538f scripts/testfun/fail.m --- a/scripts/testfun/fail.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/testfun/fail.m Fri Apr 01 18:16:01 2016 -0700 @@ -142,9 +142,8 @@ %!fail ("[1,2]*[2,3]", "nonconformant") %!fail ("fail ('[1,2]*[2;3]', 'nonconformant')", "expected error but got none") %!fail ("fail ('[1,2]*[2,3]', 'usage:')", "expected error \nbut got.*nonconformant") -%!fail ("warning ('test warning')", "warning", "test warning"); - -#%!fail ("warning ('next test')",'warning','next test'); # only allowed one warning test?!? +%!fail ("warning ('test warning')", "warning", "test warning") +%!fail ("warning ('next test')", 'warning', 'next test') ## Test that fail() itself will generate an error %!error fail ("1") diff -r ecce63c99c3f -r 6fab85c1538f scripts/time/etime.m --- a/scripts/time/etime.m Fri Apr 01 16:03:29 2016 -0700 +++ b/scripts/time/etime.m Fri Apr 01 18:16:01 2016 -0700 @@ -75,7 +75,7 @@ %! assert (etime (t5, t1), 13); ## Test input validation -%!error etime (); -%!error etime (1); -%!error etime (1, 2, 3); +%!error etime () +%!error etime (1) +%!error etime (1, 2, 3) diff -r ecce63c99c3f -r 6fab85c1538f test/build-sparse-tests.sh --- a/test/build-sparse-tests.sh Fri Apr 01 16:03:29 2016 -0700 +++ b/test/build-sparse-tests.sh Fri Apr 01 18:16:01 2016 -0700 @@ -583,8 +583,8 @@ %! assert (Is, If); %! assert (Js, Jf); %! assert (Vs, Vf); -%!error as(0,1); -%!error as(1,0); +%!error as(0,1) +%!error as(1,0) %!assert (find (as), find (af)) %!test %! [i,j,v] = find (as); diff -r ecce63c99c3f -r 6fab85c1538f test/classes/classes.tst --- a/test/classes/classes.tst Fri Apr 01 16:03:29 2016 -0700 +++ b/test/classes/classes.tst Fri Apr 01 18:16:01 2016 -0700 @@ -240,13 +240,13 @@ %% Test overloaded mpower (^) for the Snork class %!test s = s1 ^ 3; assert (isa (s, 'Snork') && isequal (s.gick, x1 ^ 3)); -%!error s = s1 ^ s1; -%!error s = 20 ^ s1; +%!error s = s1 ^ s1 +%!error s = 20 ^ s1 %% Test overloaded power (.^) for the Snork class %!test s = s1 .^ 2; assert (isa (s, 'Snork') && isequal (s.gick, x1 .^ 2)); -%!error s = s1 .^ s1; -%!error s = 20 .^ s1; +%!error s = s1 .^ s1 +%!error s = 20 .^ s1 %% Test overloaded rdivide (./) for the Snork class %!test s = s1 ./ s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 ./ x2)); @@ -331,8 +331,8 @@ %!assert (isa (x3, 'Blork') && isequal (size (x3), [2 2])) %!test x3 = [x2; [51 x1]]; %!assert (isa (x3, 'Blork') && isequal (size (x3), [2 2])) -%!error x4 = [x1, x3]; -%!error x4 = [x1; x3]; +%!error x4 = [x1, x3] +%!error x4 = [x1; x3] %%%%%%%%%%%%%%%%%%%%%%%% %% Testing precedence %% @@ -351,7 +351,7 @@ %!assert (isequal (tattack (A, B), 'CPrecedenceTester2')) %!assert (isequal (tattack (B, A), 'CPrecedenceTester2')) %% Trying to change to CPrecendenceTester < Snork -%!error D = CPrecedenceTester2 (2); +%!error D = CPrecedenceTester2 (2) %!shared A, B %!test A = Snork (rand (2)); @@ -359,7 +359,7 @@ %!assert (isequal (tattack (A, B), 'Snork')) %!assert (isequal (tattack (B, A), 'Snork')) %% Trying to change to CPrecendenceTester3 > Snork -%!error D = CPrecedenceTester3 (1); +%!error D = CPrecedenceTester3 (1) ############################################## ## Testing overridden size+numel method ## diff -r ecce63c99c3f -r 6fab85c1538f test/ctor-vs-method/ctor-vs-method.tst --- a/test/ctor-vs-method/ctor-vs-method.tst Fri Apr 01 16:03:29 2016 -0700 +++ b/test/ctor-vs-method/ctor-vs-method.tst Fri Apr 01 18:16:01 2016 -0700 @@ -26,7 +26,7 @@ %! d = derived (); %! o = other (); %! -%!error method (o); +%!error method (o) %!test %! ctrace = {'begin parent/method'; diff -r ecce63c99c3f -r 6fab85c1538f test/index.tst --- a/test/index.tst Fri Apr 01 16:03:29 2016 -0700 +++ b/test/index.tst Fri Apr 01 18:16:01 2016 -0700 @@ -216,10 +216,10 @@ %!assert (d(2), 0) %!assert (dd(2), 0) %!assert (dd(6,1), 0) -%!error d(6,6); -%!error dd(6,6); -%!error d(3,6); -%!error dd(3,6); +%!error d(6,6) +%!error dd(6,6) +%!error d(3,6) +%!error dd(3,6) ## bug 31287 %!test @@ -410,7 +410,7 @@ %!shared x, y %! y = ones (2, 2); %! x = ones (2, 2); -%!error x(1, 1, []) = []; +%!error x(1, 1, []) = [] %!shared x, y %! y = ones (2, 2); diff -r ecce63c99c3f -r 6fab85c1538f test/io.tst --- a/test/io.tst Fri Apr 01 16:03:29 2016 -0700 +++ b/test/io.tst Fri Apr 01 18:16:01 2016 -0700 @@ -428,8 +428,8 @@ %!assert (ischar (tempname ())) -%!error tempname (1); -%!error tempname ("foo", 1); +%!error tempname (1) +%!error tempname ("foo", 1) %!error tempname (1, 2, 3) diff -r ecce63c99c3f -r 6fab85c1538f test/struct.tst --- a/test/struct.tst Fri Apr 01 16:03:29 2016 -0700 +++ b/test/struct.tst Fri Apr 01 18:16:01 2016 -0700 @@ -26,13 +26,13 @@ %! c = fieldnames (s.a); %! assert (iscell (c) && strcmp (c{1}, "b")); -%!error fieldnames (); +%!error fieldnames () %!test %! s.a = 1; %! fail ("fieldnames (s, 1)", "Invalid call to fieldnames"); -%!error fieldnames (1); +%!error fieldnames (1) %!test %! s.aaa = 1; @@ -44,7 +44,7 @@ %! s.a = 2; %! assert (!(isfield (s, "b"))); -%!error isfield (); +%!error isfield () %!test %! s.aaa = 1; @@ -74,7 +74,7 @@ %! s.a.b = 1; %! assert (isstruct (s.a)); -%!error isstruct (); +%!error isstruct () %!test %! s.a = 1;