Mercurial > octave
annotate test/while.tst @ 31191:bb9d776eafac stable
Fix wrong color in PDF printout of some latex strings (bug #62884)
* octave-svgconvert (draw): For "rect" elements only set brush color if
necessary and eventually restore to previous color.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Sun, 14 Aug 2022 18:24:07 +0200 |
parents | 796f54d4ddbf |
children | 597f3ee61a48 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
3 ## Copyright (C) 2006-2022 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
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
7016 | 7 ## |
8 ## This file is part of Octave. | |
9 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
7016 | 11 ## 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
|
12 ## 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
|
13 ## (at your option) any later version. |
7016 | 14 ## |
15 ## Octave is distributed in the hope that it will be useful, but | |
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
7016 | 19 ## |
20 ## You should have received a copy of the GNU General Public License | |
21 ## 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
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
7016 | 25 |
5590 | 26 %!test |
27 %! i = 0; | |
28 %! 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
|
29 %! i++; |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
30 %! __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
|
31 %! 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
|
32 %! assert (__prog_output_assert__ ("")); |
5590 | 33 |
34 %!test | |
35 %! i = 5; | |
36 %! while (--i) | |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
37 %! __printf_assert__ ("%d", i); |
5590 | 38 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
39 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
40 %! assert (__prog_output_assert__ ("4321")); |
5590 | 41 |
42 %!test | |
43 %! i = 5; | |
44 %! while (i) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
45 %! i--; |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
46 %! __printf_assert__ ("%d", i); |
5590 | 47 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
48 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
49 %! assert (__prog_output_assert__ ("43210")); |
5590 | 50 |
51 %!test | |
52 %! i = 0; | |
53 %! 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
|
54 %! if (i > 2) |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
55 %! break; |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
56 %! endif |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
57 %! __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
|
58 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
59 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
60 %! assert (__prog_output_assert__ ("12")); |
5590 | 61 |
62 %!test | |
63 %! i = 0; | |
64 %! 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
|
65 %! if (i < 3) |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
66 %! continue; |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
67 %! endif |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
68 %! __printf_assert__ ("%d", i); |
5590 | 69 %! endwhile |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
70 %! __printf_assert__ ("\n"); |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
71 %! assert (__prog_output_assert__ ("34")); |
5590 | 72 |
16681
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
73 %% 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
|
74 %% 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
|
75 %!test |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
76 %! i = 0; |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
77 %! while (++i < 5) |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
78 %! 'foo'; |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
79 %! endwhile |
d3619d4d267c
recognize character string at beginning of statement (bug #38926, #38958)
John W. Eaton <jwe@octave.org>
parents:
16030
diff
changeset
|
80 %! assert (i, 5); |