Mercurial > octave
changeset 28929:9e43deb9bfc3
maint: Use semicolon after assert statement inside %!test blocks.
* interpft.m, ind2rgb.m, null.m, inputParser.m, inputname.m, ode15i.m,
ode15s.m, ode23.m, ode23s.m, ode45.m, pathdef.m, camlookat.m, camzoom.m,
material.m, deconv.m, ismember.m, eigs.m, gmres.m, ilu.m, tfqmr.m, perms.m,
sinint.m, gallery.m, mean.m:
maint: Use semicolon after assert statement inside %!test blocks.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 14 Oct 2020 11:46:55 -0700 |
parents | ae7ce8358953 |
children | 2883b3d08b7e |
files | scripts/general/interpft.m scripts/image/ind2rgb.m scripts/linear-algebra/null.m scripts/miscellaneous/inputParser.m scripts/miscellaneous/inputname.m scripts/ode/ode15i.m scripts/ode/ode15s.m scripts/ode/ode23.m scripts/ode/ode23s.m scripts/ode/ode45.m scripts/path/pathdef.m scripts/plot/appearance/camlookat.m scripts/plot/appearance/camzoom.m scripts/plot/appearance/material.m scripts/polynomial/deconv.m scripts/set/ismember.m scripts/sparse/eigs.m scripts/sparse/gmres.m scripts/sparse/ilu.m scripts/sparse/tfqmr.m scripts/specfun/perms.m scripts/specfun/sinint.m scripts/special-matrix/gallery.m scripts/statistics/mean.m |
diffstat | 24 files changed, 117 insertions(+), 117 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/interpft.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/general/interpft.m Wed Oct 14 11:46:55 2020 -0700 @@ -118,11 +118,11 @@ %!shared n,y %! x = [0:10]'; y = sin(x); n = length (x); %!testif HAVE_FFTW -%! assert (interpft (y, n), y, 20*eps) +%! assert (interpft (y, n), y, 20*eps); %!testif HAVE_FFTW -%! assert (interpft (y', n), y', 20*eps) +%! assert (interpft (y', n), y', 20*eps); %!testif HAVE_FFTW -%! assert (interpft ([y,y],n), [y,y], 20*eps) +%! assert (interpft ([y,y],n), [y,y], 20*eps); ## Test case with complex input %!testif HAVE_FFTW <*39566> @@ -132,13 +132,13 @@ ## Test for correct spectral symmetry with even/odd lengths %!testif HAVE_FFTW -%! assert (max (abs (imag (interpft ([1:8], 20)))), 0, 20*eps) +%! assert (max (abs (imag (interpft ([1:8], 20)))), 0, 20*eps); %!testif HAVE_FFTW -%! assert (max (abs (imag (interpft ([1:8], 21)))), 0, 21*eps) +%! assert (max (abs (imag (interpft ([1:8], 21)))), 0, 21*eps); %!testif HAVE_FFTW -%! assert (max (abs (imag (interpft ([1:9], 20)))), 0, 20*eps) +%! assert (max (abs (imag (interpft ([1:9], 20)))), 0, 20*eps); %!testif HAVE_FFTW -%! assert (max (abs (imag (interpft ([1:9], 21)))), 0, 21*eps) +%! assert (max (abs (imag (interpft ([1:9], 21)))), 0, 21*eps); ## Test input validation %!error <Invalid call> interpft ()
--- a/scripts/image/ind2rgb.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/image/ind2rgb.m Wed Oct 14 11:46:55 2020 -0700 @@ -127,10 +127,10 @@ %! cmap = repmat (linspace (0, 1, 9)(:), [1 3]); %! ind = [0 3 6; 1 4 7; 2 5 8]; %! rgb = repmat (reshape (linspace (0, 1, 9), [3 3]), [1 1 3]); -%! assert (ind2rgb (uint8 (ind), cmap), rgb) -%! assert (ind2rgb (uint16 (ind), cmap), rgb) -%! assert (ind2rgb (uint32 (ind), cmap), rgb) -%! assert (ind2rgb (uint64 (ind), cmap), rgb) +%! assert (ind2rgb (uint8 (ind), cmap), rgb); +%! assert (ind2rgb (uint16 (ind), cmap), rgb); +%! assert (ind2rgb (uint32 (ind), cmap), rgb); +%! assert (ind2rgb (uint64 (ind), cmap), rgb); %! fail ("ind2rgb (int8 (ind), cmap)", "X must be an indexed image") %! fail ("ind2rgb (int16 (ind), cmap)", "X must be an indexed image") %! fail ("ind2rgb (int32 (ind), cmap)", "X must be an indexed image") @@ -139,8 +139,8 @@ %! cmap(65541,:) = cmap(9,:); # index outside the uint16 range %! cmap(9,:) = 0; %! ind(3,3) = 65540; -%! assert (ind2rgb (uint32 (ind), cmap), rgb) -%! assert (ind2rgb (uint64 (ind), cmap), rgb) +%! assert (ind2rgb (uint32 (ind), cmap), rgb); +%! assert (ind2rgb (uint64 (ind), cmap), rgb); %!test <*59242> %! warning ("off", "Octave:ind2rgb:invalid-idx-img", "local");
--- a/scripts/linear-algebra/null.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/linear-algebra/null.m Wed Oct 14 11:46:55 2020 -0700 @@ -88,7 +88,7 @@ %!test %! A = [1 0; 0 1]; %! assert (null (A), zeros (2,0)); -%! assert (null (single (A)), zeros (2, 0, "single")) +%! assert (null (single (A)), zeros (2, 0, "single")); %!test %! A = [1 0; 1 0]; @@ -96,8 +96,8 @@ %!test %! A = [1 1; 0 0]; -%! assert (null (A), [-1/sqrt(2) 1/sqrt(2)]', eps) -%! assert (null (single (A)), single ([-1/sqrt(2) 1/sqrt(2)]'), eps) +%! assert (null (A), [-1/sqrt(2) 1/sqrt(2)]', eps); +%! assert (null (single (A)), single ([-1/sqrt(2) 1/sqrt(2)]'), eps); %!test %! tol = 1e-4;
--- a/scripts/miscellaneous/inputParser.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/miscellaneous/inputParser.m Wed Oct 14 11:46:55 2020 -0700 @@ -695,8 +695,8 @@ %! p.addOptional ("err", "foo", @error); %! p.addParameter ("not_err", "bar", @ischar); %! p.parse ("not_err", "qux"); -%! assert (p.Results.err, "foo") -%! assert (p.Results.not_err, "qux") +%! assert (p.Results.err, "foo"); +%! assert (p.Results.not_err, "qux"); ## With more Parameters to test StructExpand @@ -721,25 +721,25 @@ %!test %! p3 = create_p3 (); %! p3.parse (struct ("line", "circle", "color", "green"), "line", "tree"); -%! assert (p3.Results.line, "tree") +%! assert (p3.Results.line, "tree"); %! p3.parse ("line", "tree", struct ("line", "circle", "color", "green")); -%! assert (p3.Results.line, "circle") +%! assert (p3.Results.line, "circle"); %!test # unmatched parameters with StructExpand %! p3 = create_p3 (); %! p3.KeepUnmatched = true; %! p3.parse (struct ("line", "circle", "color", "green", "bar", "baz")); -%! assert (p3.Unmatched.bar, "baz") +%! assert (p3.Unmatched.bar, "baz"); ## The validation for the second optional argument throws an error with ## a struct so check that we can handle it. %!test %! p3 = create_p3 (); %! p3.parse ("foo", struct ("color", "green"), "line", "tree"); -%! assert (p3.Results.op1, "foo") -%! assert (p3.Results.line, "tree") -%! assert (p3.Results.color, "green") -%! assert (p3.Results.verbose, false) +%! assert (p3.Results.op1, "foo"); +%! assert (p3.Results.line, "tree"); +%! assert (p3.Results.color, "green"); +%! assert (p3.Results.verbose, false); ## Some simple tests for addParamValue since all the other ones use add @@ -749,15 +749,15 @@ %! addParameter (p, "line", "tree", @(x) any (strcmp (x, {"tree", "circle"}))); %! addParameter (p, "color", "red", @(x) any (strcmp (x, {"red", "green"}))); %! p.parse ("line", "circle"); -%! assert ({p.Results.line, p.Results.color}, {"circle", "red"}) +%! assert ({p.Results.line, p.Results.color}, {"circle", "red"}); %!test %! p = inputParser (); %! p.addParameter ("foo", "bar", @ischar); %! p.parse (); -%! assert (p.Results, struct ("foo", "bar")) +%! assert (p.Results, struct ("foo", "bar")); %! p.parse ("foo", "qux"); -%! assert (p.Results, struct ("foo", "qux")) +%! assert (p.Results, struct ("foo", "qux")); ## This behaviour means that a positional option can never be a string ## that is the name of a parameter key. This is required for Matlab @@ -767,16 +767,16 @@ %! p.addOptional ("op1", "val"); %! p.addParameter ("line", "tree"); %! p.parse ("line", "circle"); -%! assert (p.Results, struct ("op1", "val", "line", "circle")) +%! assert (p.Results, struct ("op1", "val", "line", "circle")); %! %! p = inputParser (); %! p.addOptional ("op1", "val1"); %! p.addOptional ("op2", "val2"); %! p.addParameter ("line", "tree"); %! p.parse ("line", "circle"); -%! assert (p.Results.op1, "val1") -%! assert (p.Results.op2, "val2") -%! assert (p.Results.line, "circle") +%! assert (p.Results.op1, "val1"); +%! assert (p.Results.op2, "val2"); +%! assert (p.Results.line, "circle"); %! %! ## If there's enough arguments to fill the positional options and %! ## param/key, it still skips positional options. @@ -809,15 +809,15 @@ %! p.addOptional ("op1", "val1"); %! p.addParameter ("line", "circle"); %! p.parse ("line"); -%! assert (p.Results, struct ("op1", "line", "line", "circle")) +%! assert (p.Results, struct ("op1", "line", "line", "circle")); %!test <*50752> %! p = inputParser (); %! p.addOptional ("op1", "val1"); %! p.addSwitch ("line"); %! p.parse ("line"); -%! assert (p.Results.op1, "val1") -%! assert (p.Results.line, true) +%! assert (p.Results.op1, "val1"); +%! assert (p.Results.line, true); %!test %! p = inputParser ();
--- a/scripts/miscellaneous/inputname.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/miscellaneous/inputname.m Wed Oct 14 11:46:55 2020 -0700 @@ -141,9 +141,9 @@ %!test %! xvar = 1; yvar = 2; -%! assert (__iname3__ (xvar), {"xvar", "", ""}); -%! assert (__iname3__ (xvar, yvar), {"xvar", "yvar", ""}); -%! assert (__iname3__ (xvar, 3, yvar), {"xvar", "", "yvar"}); +%! assert (__iname3__ (xvar), {"xvar", "", ""}); +%! assert (__iname3__ (xvar, yvar), {"xvar", "yvar", ""}); +%! assert (__iname3__ (xvar, 3, yvar), {"xvar", "", "yvar"}); ## Test numbers, expressions, indexing operations %!test
--- a/scripts/ode/ode15i.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/ode/ode15i.m Wed Oct 14 11:46:55 2020 -0700 @@ -521,13 +521,13 @@ %! A = eye (2); %! [tout, yout] = ode15i (@(t, y, yp) A * y - A * yp, ... %! [0, 1], [1, 1], [1, 1]); -%! assert (size (yout), [20, 2]) +%! assert (size (yout), [20, 2]); %!testif HAVE_SUNDIALS %! A = eye (2); %! [tout, yout] = ode15i (@(t, y, yp) A * y - A * yp, ... %! [0, 1], [1, 1], [1; 1]); -%! assert (size (yout), [20, 2]) +%! assert (size (yout), [20, 2]); ## Jacobian fun wrong dimension %!testif HAVE_SUNDIALS
--- a/scripts/ode/ode15s.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/ode/ode15s.m Wed Oct 14 11:46:55 2020 -0700 @@ -731,7 +731,7 @@ %!testif HAVE_SUNDIALS %! A = zeros (2); %! [tout, yout] = ode15s (@(t, y) A * y, [0, 1], [1, 1]); -%! assert (yout, ones (18, 2)) +%! assert (yout, ones (18, 2)); %!testif HAVE_SUNDIALS %! A = zeros (2);
--- a/scripts/ode/ode23.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/ode/ode23.m Wed Oct 14 11:46:55 2020 -0700 @@ -426,7 +426,7 @@ %!test # hermite_cubic_interpolation %! opt = odeset ("RelTol", 1e-8, "NormControl", "on"); %! [t,sol] = ode23(@(t,x)[x(2);x(1)],linspace(0,1),[1;0],opt); -%! assert (max (abs (sol(:,1)-cosh (t))),0,1e-6) +%! assert (max (abs (sol(:,1)-cosh (t))),0,1e-6); %!test # RelTol and NormControl option -- higher accuracy %! opt = odeset ("RelTol", 1e-8, "NormControl", "on"); %! sol = ode23 (@fpol, [0 2], [2 0], opt); @@ -497,9 +497,9 @@ %!test # Check that imaginary part of solution does not get inverted %! sol = ode23 (@(x,y) 1, [0 1], 1i); -%! assert (imag (sol.y), ones (size (sol.y))) +%! assert (imag (sol.y), ones (size (sol.y))); %! [x, y] = ode23 (@(x,y) 1, [0 1], 1i); -%! assert (imag (y), ones (size (y))) +%! assert (imag (y), ones (size (y))); ## Test input validation %!error <Invalid call> ode23 ()
--- a/scripts/ode/ode23s.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/ode/ode23s.m Wed Oct 14 11:46:55 2020 -0700 @@ -495,9 +495,9 @@ %!test # Check that imaginary part of solution does not get inverted %! sol = ode23s (@(x,y) 1, [0 1], 1i); -%! assert (imag (sol.y), ones (size (sol.y))) +%! assert (imag (sol.y), ones (size (sol.y))); %! [x, y] = ode23s (@(x,y) 1, [0 1], 1i); -%! assert (imag (y), ones (size (y))) +%! assert (imag (y), ones (size (y))); ## Test input validation %!error <Invalid call> ode23s ()
--- a/scripts/ode/ode45.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/ode/ode45.m Wed Oct 14 11:46:55 2020 -0700 @@ -510,9 +510,9 @@ %!test # Check that imaginary part of solution does not get inverted %! sol = ode45 (@(x,y) 1, [0 1], 1i); -%! assert (imag (sol.y), ones (size (sol.y))) +%! assert (imag (sol.y), ones (size (sol.y))); %! [x, y] = ode45 (@(x,y) 1, [0 1], 1i); -%! assert (imag (y), ones (size (y))) +%! assert (imag (y), ones (size (y))); %!error <Invalid call> ode45 () %!error <Invalid call> ode45 (1)
--- a/scripts/path/pathdef.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/path/pathdef.m Wed Oct 14 11:46:55 2020 -0700 @@ -108,8 +108,8 @@ %! addpath (tmp_dir); %! p1 = path (); %! p2 = pathdef (); -%! assert (! isempty (strfind (p1, tmp_dir))) -%! assert (isempty (strfind (p2, tmp_dir))) +%! assert (! isempty (strfind (p1, tmp_dir))); +%! assert (isempty (strfind (p2, tmp_dir))); %! unwind_protect_cleanup %! sts = rmdir (tmp_dir); %! path (path_orig); @@ -126,7 +126,7 @@ %! path_1 = path (); %! p = pathdef (); %! path_2 = path (); -%! assert (path_1, path_2) +%! assert (path_1, path_2); %! unwind_protect_cleanup %! sts = rmdir (tmp_dir); %! path (path_orig);
--- a/scripts/plot/appearance/camlookat.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/plot/appearance/camlookat.m Wed Oct 14 11:46:55 2020 -0700 @@ -201,7 +201,7 @@ %! camlookat (h2); %! dir2 = camtarget () - campos (); %! dir2 /= norm (dir2); -%! assert (dir, dir2, -2*eps) +%! assert (dir, dir2, -2*eps); %! camlookat ([h1 h2]); %! dir2 = camtarget () - campos (); %! dir2 /= norm (dir2);
--- a/scripts/plot/appearance/camzoom.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/plot/appearance/camzoom.m Wed Oct 14 11:46:55 2020 -0700 @@ -121,7 +121,7 @@ %! ## Matlab 2016a %! xm = 10.339584907201974; %! ym = 5.1803362845094822; -%! assert (tand (x/2) / tand (y/2), tand (xm/2) / tand (ym/2), 2e-14) +%! assert (tand (x/2) / tand (y/2), tand (xm/2) / tand (ym/2), 2e-14); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect @@ -138,7 +138,7 @@ %! ## Matlab 2014a %! xm = 13.074668029506947; %! ym = 2.6258806698721222; -%! assert (tand (x/2) / tand (y/2), tand (xm/2) / tand (ym/2), 2e-14) +%! assert (tand (x/2) / tand (y/2), tand (xm/2) / tand (ym/2), 2e-14); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect @@ -154,7 +154,7 @@ %! camzoom (hax1, 2) %! x = camva (hax1); %! y = camva (hax2); -%! assert (tand (y/2) / tand (x/2), 2, 2*eps) +%! assert (tand (y/2) / tand (x/2), 2, 2*eps); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect
--- a/scripts/plot/appearance/material.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/plot/appearance/material.m Wed Oct 14 11:46:55 2020 -0700 @@ -296,7 +296,7 @@ %!test %! refl_props = material ("metal"); -%! assert (refl_props, {0.3, 0.3, 1, 25, 0.5}) +%! assert (refl_props, {0.3, 0.3, 1, 25, 0.5}); ## Test input validation %!error <Invalid call to material> material ()
--- a/scripts/polynomial/deconv.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/polynomial/deconv.m Wed Oct 14 11:46:55 2020 -0700 @@ -117,22 +117,22 @@ %! y = (10:-1:1); %! a = (4:-1:1); %! [b, r] = deconv (y, a); -%! assert (conv (a, b) + r, y, eps) +%! assert (conv (a, b) + r, y, eps); %!test <*51221> %! a = [1.92306958582241e+15, 3.20449986572221e+24, 1.34271290136344e+32, ... %! 2.32739765751038e+38]; %! b = [7.33727670161595e+27, 1.05919311870816e+36, 4.56169848520627e+42]; %! [div, rem] = deconv (a, b); -%! assert (rem, [0, 0, -2.89443678763879e+32 -1.58695290534499e+39], -10*eps) +%! assert (rem, [0, 0, -2.89443678763879e+32 -1.58695290534499e+39], -10*eps); %! a(2) = 3.204499865722215e+24; %! [div, rem] = deconv (a, b); -%! assert (rem, [0, 0, -2.89443678763879e+32 -1.58695290534499e+39], -10*eps) +%! assert (rem, [0, 0, -2.89443678763879e+32 -1.58695290534499e+39], -10*eps); %!test %! [b, r] = deconv ([1, 1], 1); -%! assert (r, [0, 0]) +%! assert (r, [0, 0]); %!test %! [b, r] = deconv ([1; 1], 1); -%! assert (r, [0; 0]) +%! assert (r, [0; 0]);
--- a/scripts/set/ismember.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/set/ismember.m Wed Oct 14 11:46:55 2020 -0700 @@ -294,7 +294,7 @@ %! assert (s_idx, 2); %! %! tf = ismember ([5, 4-3j, 3+4j], 5); -%! assert (tf, logical ([1, 0, 0])) +%! assert (tf, logical ([1, 0, 0])); %! [~, s_idx] = ismember ([5, 4-3j, 3+4j], 5); %! assert (s_idx, [1, 0, 0]); %!
--- a/scripts/sparse/eigs.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/sparse/eigs.m Wed Oct 14 11:46:55 2020 -0700 @@ -781,7 +781,7 @@ %! B = toeplitz (sparse ([1, 1], [1, 2], [2, 1], 1, 10)); %! [v, d] = eigs (A, B, 4, "lm"); %! for i = 1:4 -%! assert (A * v(:,i), d(i, i) * B * v(:,i), 1e-12) +%! assert (A * v(:,i), d(i, i) * B * v(:,i), 1e-12); %! endfor %! ddiag = diag (d); %! [ddiag, idx] = sort (ddiag); @@ -881,7 +881,7 @@ %! opts.cholB = true; %! [v, d] = eigs (A, R, 4, "lm", opts); %! for i = 1:4 -%! assert (A * v(:,i), d(i, i) * B * v(:,i), 1e-12) +%! assert (A * v(:,i), d(i, i) * B * v(:,i), 1e-12); %! endfor %!testif HAVE_ARPACK, HAVE_UMFPACK %! A = toeplitz (sparse (1:10)); @@ -891,7 +891,7 @@ %! opts.permB = permB; %! [v, d] = eigs (A, R, 4, "lm", opts); %! for i = 1:4 -%! assert (A * v(:,i), d(i, i) * B * v(:,i), 1e-12) +%! assert (A * v(:,i), d(i, i) * B * v(:,i), 1e-12); %! endfor
--- a/scripts/sparse/gmres.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/sparse/gmres.m Wed Oct 14 11:46:55 2020 -0700 @@ -564,7 +564,7 @@ %! b = sum (A, 2); %! [x, flag] = gmres(A, b, [], [], 5); %! assert (flag, 0); -%! assert (x, ones (5, 1), -1e-06) +%! assert (x, ones (5, 1), -1e-06); %!test %! ## Maximum number of iteration reached @@ -580,56 +580,56 @@ %! I = eye (3); %! M = [1 0 0; 0 1 0; 0 0 0]; # the last row is zero %! [x, flag] = gmres(@(y) AA * y, bb, [], [], [], @(y) M \ y, @(y) y); -%! assert (flag, 2) +%! assert (flag, 2); %!test %! A = rand (4); %! A = A' * A; %! [x, flag] = gmres (A, zeros (4, 1), [], [], [], [], [], ones (4, 1)); -%! assert (x, zeros (4, 1)) +%! assert (x, zeros (4, 1)); %!test %! A = rand (4); %! b = zeros (4, 1); %! [x, flag, relres, iter] = gmres (A, b); -%! assert (relres, 0) +%! assert (relres, 0); %!test %! A = toeplitz (sparse ([2, 1, 0, 0, 0]), sparse ([2, -1, 0, 0, 0])); %! b = A * ones (5, 1); %! [x, flag, relres, iter] = gmres (A, b, [], [], [], [], [], ... %! ones (5, 1) + 1e-8); -%! assert (iter, [0, 0]) +%! assert (iter, [0, 0]); %!test %! A = rand (20); %! b = A * ones (20, 1); %! [x, flag, relres, iter, resvec] = gmres (A, b, [], [], 1); -%! assert (iter, [1, 1]) +%! assert (iter, [1, 1]); %!test %! A = hilb (20); %! b = A * ones (20, 1); %! [x, flag, relres, iter, resvec] = gmres (A, b ,5, 1e-14); -%! assert (iter, [4, 5]) +%! assert (iter, [4, 5]); %!test %! A = single (1); %! b = 1; %! [x, flag] = gmres (A, b); -%! assert (class (x), "single") +%! assert (class (x), "single"); %!test %! A = 1; %! b = single (1); %! [x, flag] = gmres (A, b); -%! assert (class (x), "single") +%! assert (class (x), "single"); %!test %! A = single (1); %! b = single (1); %! [x, flag] = gmres (A, b); -%! assert (class (x), "single") +%! assert (class (x), "single"); %!test %!function y = Afun (x) @@ -637,11 +637,11 @@ %! y = A * x; %!endfunction %! [x, flag] = gmres ("Afun", [1; 2; 2; 3]); -%! assert (x, ones (4, 1), 1e-6) +%! assert (x, ones (4, 1), 1e-6); %!test # preconditioned residual %! A = toeplitz (sparse ([2, 1, 0, 0, 0]), sparse ([2, -1, 0, 0, 0])); %! b = sum (A, 2); %! M = magic (5); %! [x, flag, relres] = gmres (A, b, [], [], 2, M); -%! assert (relres, norm (M \ (b - A * x)) / norm (M \ b), 8 * eps) +%! assert (relres, norm (M \ (b - A * x)) / norm (M \ b), 8 * eps);
--- a/scripts/sparse/ilu.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/sparse/ilu.m Wed Oct 14 11:46:55 2020 -0700 @@ -507,7 +507,7 @@ %! A = sparse (magic (4)); %! opts.type = "ilutp"; %! [L, U] = ilu (A, opts); -%! assert (L * U, A, eps) +%! assert (L * U, A, eps); ## Tests for input validation %!shared A_tiny, opts
--- a/scripts/sparse/tfqmr.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/sparse/tfqmr.m Wed Oct 14 11:46:55 2020 -0700 @@ -428,31 +428,31 @@ %! A (1,50) = 10000; %! b = ones (50,1); %! [x, flag, relres, iter, resvec] = tfqmr (A, b, [], 100); -%! assert (flag, 0) -%! assert (x, A \ b, 1e-05) +%! assert (flag, 0); +%! assert (x, A \ b, 1e-05); %! ## Detects a singular preconditioner %! M = ones (50); %! M(1, 1) = 0; %! [x, flag] = tfqmr (A, b, [], 100, M); -%! assert (flag, 2) +%! assert (flag, 2); %!test %! A = single (1); %! b = 1; %! [x, flag] = tfqmr (A, b); -%! assert (class (x), "single") +%! assert (class (x), "single"); %!test %! A = 1; %! b = single (1); %! [x, flag] = tfqmr (A, b); -%! assert (class (x), "single") +%! assert (class (x), "single"); %!test %! A = single (1); %! b = single (1); %! [x, flag] = tfqmr (A, b); -%! assert (class (x), "single") +%! assert (class (x), "single"); %!test %!function y = Afun (x) @@ -460,14 +460,14 @@ %! y = A * x; %!endfunction %! [x, flag] = tfqmr ("Afun", [1; 2; 2; 3]); -%! assert (x, ones (4, 1), 1e-6) +%! assert (x, ones (4, 1), 1e-6); %!test # unpreconditioned residual %! A = toeplitz (sparse ([2, 1, 0, 0, 0]), sparse ([2, -1, 0, 0, 0])); %! b = sum (A, 2); %! M = magic (5); %! [x, flag, relres] = tfqmr (A, b, [], 3, M); -%! assert (relres, norm (b - A * x) / norm (b), 8 * eps) +%! assert (relres, norm (b - A * x) / norm (b), 8 * eps); %!demo # simplest use %! n = 20;
--- a/scripts/specfun/perms.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/specfun/perms.m Wed Oct 14 11:46:55 2020 -0700 @@ -160,5 +160,5 @@ %!test <*52432> %! s = struct (); %! s(1) = []; -%! assert (perms (reshape (s, 0, 0)), reshape (s, 1, 0)) -%! assert (perms (reshape (s, 0, 1)), reshape (s, 1, 0)) +%! assert (perms (reshape (s, 0, 0)), reshape (s, 1, 0)); +%! assert (perms (reshape (s, 0, 1)), reshape (s, 1, 0));
--- a/scripts/specfun/sinint.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/specfun/sinint.m Wed Oct 14 11:46:55 2020 -0700 @@ -202,9 +202,9 @@ %! -0.000099999999944461111128 + 0.99999999833338888972e-6*1i %! -1.5386156269726011209 - 0.053969388020443786229*1i ]; %! B = sinint (x); -%! assert (A, B, -3*eps) +%! assert (A, B, -3*eps); %! B = sinint (single (x)); -%! assert (A, B, -3*eps ("single")) +%! assert (A, B, -3*eps ("single")); ## FIXME: Need a test for bug #52953 %#!test <*52953>
--- a/scripts/special-matrix/gallery.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/special-matrix/gallery.m Wed Oct 14 11:46:55 2020 -0700 @@ -2930,9 +2930,9 @@ %! 4 5 6 7 8 %! 5 6 7 8 9 %! 6 7 8 9 10]; -%! assert (gallery ("cauchy", 5), exp) -%! assert (gallery ("cauchy", 1:5), exp) -%! assert (gallery ("cauchy", 1:5, 1:5), exp) +%! assert (gallery ("cauchy", 5), exp); +%! assert (gallery ("cauchy", 1:5), exp); +%! assert (gallery ("cauchy", 1:5, 1:5), exp); %! %! exp = 1 ./ [ %! 1 2 3 4 5 @@ -2940,9 +2940,9 @@ %! 3 4 5 6 7 %! 4 5 6 7 8 %! 5 6 7 8 9]; -%! assert (gallery ("cauchy", 0:4, 1:5), exp) -%! assert (gallery ("cauchy", 1:5, 0:4), exp) -%! assert (gallery ("cauchy", 1:5, 4:-1:0), fliplr (exp)) +%! assert (gallery ("cauchy", 0:4, 1:5), exp); +%! assert (gallery ("cauchy", 1:5, 0:4), exp); +%! assert (gallery ("cauchy", 1:5, 4:-1:0), fliplr (exp)); %! %! exp = 1 ./ [ %! -1 0 1 2 3 @@ -2950,16 +2950,16 @@ %! 1 2 3 4 5 %! 2 3 4 5 6 %! 3 4 5 6 7]; -%! assert (gallery ("cauchy", 1:5, -2:2), exp) +%! assert (gallery ("cauchy", 1:5, -2:2), exp); %! %! exp = 1 ./ [ %! 8 18 -4 2 %! 13 23 1 7 %! 9 19 -3 3 %! 15 25 3 9]; -%! assert (gallery ("cauchy", [-2 3 -1 5], [10 20 -2 4]), exp) -%! assert (gallery ("cauchy", [-2 3 -1 5], [10 20 -2 4]'), exp) -%! assert (gallery ("cauchy", [-2 3 -1 5]', [10 20 -2 4]), exp) +%! assert (gallery ("cauchy", [-2 3 -1 5], [10 20 -2 4]), exp); +%! assert (gallery ("cauchy", [-2 3 -1 5], [10 20 -2 4]'), exp); +%! assert (gallery ("cauchy", [-2 3 -1 5]', [10 20 -2 4]), exp); %!assert (size (gallery ("chebspec", 5)), [5 5]) %!assert (size (gallery ("chebspec", 5, 1)), [5 5]) @@ -3006,10 +3006,10 @@ %! 2 1 0 1 2 %! 3 2 1 0 1 %! 4 3 2 1 0]; -%! assert (gallery ("fiedler", 5), exp) -%! assert (gallery ("fiedler", 1:5), exp) -%! assert (gallery ("fiedler", -2:2), exp) -%! assert (gallery ("fiedler", 2:5), exp(1:4,1:4)) +%! assert (gallery ("fiedler", 5), exp); +%! assert (gallery ("fiedler", 1:5), exp); +%! assert (gallery ("fiedler", -2:2), exp); +%! assert (gallery ("fiedler", 2:5), exp(1:4,1:4)); %!assert (size (gallery ("forsythe", 5)), [5 5]) %!assert (size (gallery ("forsythe", 5, 1, 0.5)), [5 5])
--- a/scripts/statistics/mean.m Wed Oct 14 07:58:12 2020 -0700 +++ b/scripts/statistics/mean.m Wed Oct 14 11:46:55 2020 -0700 @@ -217,25 +217,25 @@ %!test %! in = [1 2 3]; %! out = 2; -%! assert (mean (in, "default"), mean (in)) -%! assert (mean (in, "default"), out) +%! assert (mean (in, "default"), mean (in)); +%! assert (mean (in, "default"), out); %! %! in = single ([1 2 3]); %! out = 2; -%! assert (mean (in, "default"), mean (in)) -%! assert (mean (in, "default"), single (out)) -%! assert (mean (in, "double"), out) -%! assert (mean (in, "native"), single (out)) +%! assert (mean (in, "default"), mean (in)); +%! assert (mean (in, "default"), single (out)); +%! assert (mean (in, "double"), out); +%! assert (mean (in, "native"), single (out)); %! %! in = uint8 ([1 2 3]); %! out = 2; -%! assert (mean (in, "default"), mean (in)) -%! assert (mean (in, "default"), out) -%! assert (mean (in, "double"), out) -%! assert (mean (in, "native"), uint8 (out)) +%! assert (mean (in, "default"), mean (in)); +%! assert (mean (in, "default"), out); +%! assert (mean (in, "double"), out); +%! assert (mean (in, "native"), uint8 (out)); %! %! in = logical ([1 0 1]); %! out = 2/3; -%! assert (mean (in, "default"), mean (in)) -%! assert (mean (in, "default"), out) -%! assert (mean (in, "native"), out) # logical ignores native option +%! assert (mean (in, "default"), mean (in)); +%! assert (mean (in, "default"), out); +%! assert (mean (in, "native"), out); # logical ignores native option