view test/bug-54490.tst @ 31150:44b9673c7b8d stable

correct subsasgn docstring example code (bug #33221) * libinterp/octave-value/ov.cc (subsasgn): add LHS variable to example code in docstring reconcile example result with the following one-line command.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Fri, 22 Jul 2022 15:30:29 -0400
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