annotate test/bug-53599.tst @ 31214:19bd1953fc1d stable

GitHub-CI: Remove ubuntu-18.04 runners from build matrix. * .github/workflow/make.yaml (ubuntu): GitHub-hosted runners for ubuntu-18.04 are being deprecated. Remove them from build matrix. See also: https://github.com/actions/runner-images/issues/6002
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 30 Aug 2022 11:16:27 +0200
parents 9080316864bf
children 332a6ccac881
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25201
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 %!function rval = sggval (val)
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 %! global gval
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 %! if (nargin == 1)
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 %! gval = val;
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 %! else
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 %! rval = gval;
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 %! endif
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 %!endfunction
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9
30110
9080316864bf update bug status in test suite
John W. Eaton <jwe@octave.org>
parents: 30109
diff changeset
10 %!test <*53599>
25201
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 %! global gval
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 %! assert (isempty (gval))
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 %! sggval (13);
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 %! assert (sggval (), 13);
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 %! assert (gval, 13);
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 %! clear global gval
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 %! assert (sggval (), [])
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 %! gval = 42;
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 %! assert (sggval (), []);
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 %! clear gval
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 %! global gval
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 %! gval = 42;
c80323fe4938 improve handling of global symbols (bug #53599)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 %! assert (sggval (), 42);
26182
34617dd78f02 avoid possible leaked global variables in tests
John W. Eaton <jwe@octave.org>
parents: 25201
diff changeset
24 %! clear -global gval; # cleanup after test