view test/bug-53599.tst @ 30904:04120d65778a stable release-7-1-0

Version 7.1.0 released * configure.ac (AC_INIT): Update version info for release. (OCTAVE_MINOR_VERSION): Set to 1. (OCTAVE_PATCH_VERSION): Set to 0. (OCTAVE_RELEASE_DATE): Set to 2022-04-06. * org.octave.Octave.appdata.xml: Add 7.1.0 to the list of version numbers and release dates. * etc/NEWS.7.md: Update release date.
author John W. Eaton <jwe@octave.org>
date Wed, 06 Apr 2022 10:05:12 -0400
parents 9080316864bf
children 332a6ccac881
line wrap: on
line source

%!function rval = sggval (val)
%!  global gval
%!  if (nargin == 1)
%!    gval = val;
%!  else
%!    rval = gval;
%!  endif
%!endfunction

%!test <*53599>
%! global gval
%! assert (isempty (gval))
%! sggval (13);
%! assert (sggval (), 13);
%! assert (gval, 13);
%! clear global gval
%! assert (sggval (), [])
%! gval = 42;
%! assert (sggval (), []);
%! clear gval
%! global gval
%! gval = 42;
%! assert (sggval (), 42);
%! clear -global gval;  # cleanup after test