view test/bug-54490.tst @ 30998:1bf26f913b9c

std.m, var.m: Cleanup functions. * std.m: Re-write documentation to be in present tense per Octave convention. Use lowercase for "all" parameter. Use Texinfo @. to end sentence ending with capital N. Check for zero arguments to function and call print_usage(). Remove BIST tests for empty inputs and bug #62395 which are simply duplicating tests in var.m. Remove input validation tests which are duplicating tests in var.m. * var.m: Re-write documentation to be in present tense per Octave convention. Use lowercase for "all" parameter. Use Texinfo @. to end sentence ending with capital N. Use default in function prototype for third input "dim" to eliminate elseif branch in input validation. Put input validation as close to top of function as possible. Rename "highest_dim" to "max_dim" for clarity & brevity. Rename "ALL" to "all" in error() statements. Replace "strcmp (tolower (...))" with strcmpi. Avoid slow call to isequal().
author Rik <rik@octave.org>
date Sat, 14 May 2022 18:03:35 -0700
parents 9080316864bf
children
line wrap: on
line source

%!function out = bug54490 ()
%!  global k;
%!  k = 1;
%!  out = 3;
%!endfunction

%!test <*54490>
%! global k;
%! k = 2;
%! a = [5, 6];
%! a(k) = bug54490 ();
%! assert (a, [5, 3]);
%! k = 2;
%! a = [5, 6];
%! [a(k)] = bug54490 ();
%! assert (a, [5, 3]);
%! clear -global k;  # cleanup after test