view test/bug-53599.tst @ 30309:bf619727bf6c

interpreter: Use UTF-8 locale on Windows if possible. * libinterp/corefcn/interpreter.cc (interpreter::interpreter): Force a UTF-8 locale on Windows if possible. * oct-conf-post.in.h (OCTAVE_HAVE_WINDOWS_UTF8_LOCALE): Assume that Windows will support UTF-8 locales when using UCRT. See also: https://octave.discourse.group/t/1821
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 21 Nov 2021 15:25:04 +0100
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