annotate test/nest/nest.tst @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
1 ## Copyright (C) 2006-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26946
diff changeset
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26946
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26946
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26946
diff changeset
5 ##
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
6 ##
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
7 ## This file is part of Octave.
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
8 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23850
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
10 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23850
diff changeset
11 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
12 ## (at your option) any later version.
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
13 ##
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
17 ## GNU General Public License for more details.
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
18 ##
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
19 ## You should have received a copy of the GNU General Public License
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
20 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23850
diff changeset
21 ## <https://www.gnu.org/licenses/>.
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
22
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
23 ################################################################################
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
24 ## This file actually executes the tests on nested functions.
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
25 ##
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
26 ## It relies on the function files defined in the nest/ directory.
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
27 ################################################################################
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
28
26182
34617dd78f02 avoid possible leaked global variables in tests
John W. Eaton <jwe@octave.org>
parents: 25111
diff changeset
29 %!test
34617dd78f02 avoid possible leaked global variables in tests
John W. Eaton <jwe@octave.org>
parents: 25111
diff changeset
30 %! assert (recursive_nest (), 25)
34617dd78f02 avoid possible leaked global variables in tests
John W. Eaton <jwe@octave.org>
parents: 25111
diff changeset
31 %! clear -global recursive_nest_inc; # cleanup after test
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
32
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
33 %!assert (recursive_nest2 (), 20)
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
34
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
35 %!assert (recursive_nest3 (), 5)
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
36
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
37 %!assert (script_nest (), 5)
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
38
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
39 %!assert (arg_ret (), 10)
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
40
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
41 %!assert (arg_nest, 1)
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
42
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
43 %!assert (varg_nest (-1), 6)
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
44
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
45 %!assert (varg_nest2, 5)
14544
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
46
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
47 %!test
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
48 %! scope0;
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
49
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
50 %!test
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
51 %! scope1 (1);
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
52
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
53 %!test
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
54 %! scope3;
be18c9e359bf Nested function support (bug #35772)
Max Brister <max@2bass.com>
parents:
diff changeset
55
21317
a4faec57f4c8 maint: remove semicolon after %!assert tests to follow Octave conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
56 %!assert (nest_eval ("x = 5;", "x = 6;"), 6)
23850
4b0e0cae49db disallow dynamic variable creation in static scopes (bug #51698)
John W. Eaton <jwe@octave.org>
parents: 23598
diff changeset
57
4b0e0cae49db disallow dynamic variable creation in static scopes (bug #51698)
John W. Eaton <jwe@octave.org>
parents: 23598
diff changeset
58 %!error <can not add variable "y" to a static workspace>
4b0e0cae49db disallow dynamic variable creation in static scopes (bug #51698)
John W. Eaton <jwe@octave.org>
parents: 23598
diff changeset
59 %! nest_eval ("x = 5;", "y = 6;");
4b0e0cae49db disallow dynamic variable creation in static scopes (bug #51698)
John W. Eaton <jwe@octave.org>
parents: 23598
diff changeset
60
4b0e0cae49db disallow dynamic variable creation in static scopes (bug #51698)
John W. Eaton <jwe@octave.org>
parents: 23598
diff changeset
61 %!error <can not add variable "y" to a static workspace>
4b0e0cae49db disallow dynamic variable creation in static scopes (bug #51698)
John W. Eaton <jwe@octave.org>
parents: 23598
diff changeset
62 %! nest_eval ("x = -5; x = abs (x);", "y = 6;")
15236
44d6ffdf9479 Disallow new variables in nested functions (bug #36271)
Max Brister <max@2bass.com>
parents: 14548
diff changeset
63
23598
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
64 %!test
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
65 %! f = no_closure (0);
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
66 %! assert (f("foo"), "nested foo");
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
67 %! assert (f("foo"), "nested foo");
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
68
26946
04e5cb5e2cb3 update bug status in tests
John W. Eaton <jwe@octave.org>
parents: 26860
diff changeset
69 %!test <*39257>
23598
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
70 %! f = no_closure (1);
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
71 %! assert (f(), "nested");
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
72 %! assert (f("foo"), "nested foo");
287b07229aff update test for handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
73
14548
604696c3ff93 maint: Add missing test/nest files to build system.
Rik <octave@nomad.inbox5.com>
parents: 14544
diff changeset
74 %!error <D' undefined near line 7> scope2
15236
44d6ffdf9479 Disallow new variables in nested functions (bug #36271)
Max Brister <max@2bass.com>
parents: 14548
diff changeset
75 %!error <can not add variable "y" to a static workspace> nest_eval ("y = 5;", "")
44d6ffdf9479 Disallow new variables in nested functions (bug #36271)
Max Brister <max@2bass.com>
parents: 14548
diff changeset
76 %!error <can not add variable "y" to a static workspace> nest_eval ("y;", "")
26825
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
77
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
78 ## Test the way that non-local variables referenced by nested functions
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
79 ## work with function handles.
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
80
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
81 ## FH1 and FH2 were created separately so will have distinct
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
82 ## closure contexts.handles, FH3 is a copy of FH2 so they will
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
83 ## share the same context.
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
84
26946
04e5cb5e2cb3 update bug status in tests
John W. Eaton <jwe@octave.org>
parents: 26860
diff changeset
85 %!test <*39257>
26825
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
86 %! fh1 = nst1 (13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
87 %! fh2 = nst1 (13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
88 %! fh3 = fh2;
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
89 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
90 %! assert (fh1 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
91 %! assert (fh2 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
92 %! assert (fh3 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
93 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
94 %! assert (fh1 (42), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
95 %! assert (fh2 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
96 %! assert (fh3 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
97 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
98 %! assert (fh2 (pi), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
99 %! assert (fh1 (), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
100 %! assert (fh3 (), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
101
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
102 ## Similar to the test above, but with persistent variables. These are
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
103 ## stored in the function, not the closure context, so are shared among
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
104 ## all handles whether they are created separately or copied.
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
105
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
106 %!test
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
107 %! fh1 = nst2 (13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
108 %! fh2 = nst2 (13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
109 %! fh3 = fh2;
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
110 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
111 %! assert (fh1 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
112 %! assert (fh2 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
113 %! assert (fh3 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
114 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
115 %! assert (fh1 (42), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
116 %! assert (fh2 (), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
117 %! assert (fh3 (), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
118 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
119 %! assert (fh2 (pi), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
120 %! assert (fh1 (), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
121 %! assert (fh3 (), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
122
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
123 ## And again with global variables.
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
124
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
125 %!test
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
126 %! fh1 = nst3 (13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
127 %! fh2 = nst3 (13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
128 %! fh3 = fh2;
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
129 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
130 %! assert (fh1 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
131 %! assert (fh2 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
132 %! assert (fh3 (), 13);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
133 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
134 %! assert (fh1 (42), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
135 %! assert (fh2 (), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
136 %! assert (fh3 (), 42);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
137 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
138 %! assert (fh2 (pi), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
139 %! assert (fh1 (), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
140 %! assert (fh3 (), pi);
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
141 %!
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
142 %! clear -global g; # cleanup after tests
26860
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
143
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
144 ## Test case from <https://stackoverflow.com/q/26238491/6579744>
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
145 %!test
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
146 %! f1 = counter ();
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
147 %! f2 = counter ();
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
148 %! observed = [f1(), f1(), f2(), f1(), f2()];
7c9a681c4474 Add fixed test BIST for nested functions (bug #39257).
Rik <rik@octave.org>
parents: 26825
diff changeset
149 %! assert (observed, [1, 2, 1, 3, 2]);