Mercurial > octave
annotate test/while.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 |
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:
26376
diff
changeset
|
2 ## |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
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:
26376
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:
26376
diff
changeset
|
5 ## |
7016 | 6 ## |
7 ## This file is part of Octave. | |
8 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
9 ## Octave is free software: you can redistribute it and/or modify it |
7016 | 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:
23220
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. |
7016 | 13 ## |
14 ## Octave is distributed in the hope that it will be useful, but | |
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. |
7016 | 18 ## |
19 ## You should have received a copy of the GNU General Public License | |
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:
23220
diff
changeset
|
21 ## <https://www.gnu.org/licenses/>. |
7016 | 22 |
5590 | 23 %!test |
24 %! i = 0; | |
25 %! while (eye (2)) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
26 %! i++; |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
27 %! __printf_assert__ ("%d\n", i); |
17309
5a65b2cc9508
test: Add tests for 'end' form of 'endfor', 'endif', etc.
Rik <rik@octave.org>
parents:
16937
diff
changeset
|
28 %! end # "end" is part of test, check not using "endwhile" |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
29 %! assert (__prog_output_assert__ ("")); |
5590 | 30 |
31 %!test | |
32 %! i = 5; | |
33 %! while (--i) | |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
34 %! __printf_assert__ ("%d", i); |
5590 | 35 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
36 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
37 %! assert (__prog_output_assert__ ("4321")); |
5590 | 38 |
39 %!test | |
40 %! i = 5; | |
41 %! while (i) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
42 %! i--; |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
43 %! __printf_assert__ ("%d", i); |
5590 | 44 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
45 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
46 %! assert (__prog_output_assert__ ("43210")); |
5590 | 47 |
48 %!test | |
49 %! i = 0; | |
50 %! while (i++ < 20) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
51 %! if (i > 2) |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
52 %! break; |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
53 %! endif |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
54 %! __printf_assert__ ("%d", i); |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
55 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
56 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
57 %! assert (__prog_output_assert__ ("12")); |
5590 | 58 |
59 %!test | |
60 %! i = 0; | |
61 %! while (++i < 5) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
62 %! if (i < 3) |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
63 %! continue; |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
64 %! endif |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
65 %! __printf_assert__ ("%d", i); |
5590 | 66 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
67 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
68 %! assert (__prog_output_assert__ ("34")); |
5590 | 69 |
16681
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
70 %% test parsing of single-quoted character string appearing immediately |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
71 %% after a while condition. |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
72 %!test |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
73 %! i = 0; |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
74 %! while (++i < 5) |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
75 %! 'foo'; |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
76 %! endwhile |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
77 %! assert (i, 5); |