Mercurial > hg > octave-nkf
annotate test/test_if.m @ 15536:2e8eb9ac43a5 stable rc-3-6-4-0
3.6.4-rc0 release candidate
* configure.ac (AC_INIT): Version is now 3.6.2-rc0.
(OCTAVE_RELEASE_DATE): Now 2012-05-11.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 17 Oct 2012 10:05:44 -0400 |
parents | 72c96de7a403 |
children | 5b2126a8c84f |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
14131
diff
changeset
|
1 ## Copyright (C) 2006-2012 John W. Eaton |
7016 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
5590 | 19 %% test/octave.test/if/if-1.m |
20 %!test | |
21 %! i = 0; | |
22 %! if (i == 0) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
23 %! i++; |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
24 %! printf_assert ("%d\n", i); |
5590 | 25 %! endif |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
26 %! assert (prog_output_assert ("1")); |
5590 | 27 |
28 %% test/octave.test/if/if-2.m | |
29 %!test | |
30 %! if (eye (2)) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
31 %! printf_assert ("fail\n"); |
5590 | 32 %! else |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
33 %! printf_assert ("pass\n"); |
5590 | 34 %! end |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
35 %! assert (prog_output_assert ("pass")); |
5590 | 36 |
37 %% test/octave.test/if/if-3.m | |
38 %!test | |
39 %! x = 2; | |
40 %! if (eye (2)) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
41 %! printf_assert ("fail\n"); |
5590 | 42 %! elseif (x) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
43 %! printf_assert ("pass\n"); |
5590 | 44 %! endif |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
45 %! assert (prog_output_assert ("pass")); |
5590 | 46 |
47 %% test/octave.test/if/if-4.m | |
48 %!test | |
49 %! x = 0; | |
50 %! y = -2; | |
51 %! if (eye (2)) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
52 %! printf_assert ("fail\n"); |
5590 | 53 %! elseif (x) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
54 %! printf_assert ("fail\n"); |
5590 | 55 %! elseif (y) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
56 %! printf_assert ("pass\n"); |
5590 | 57 %! end |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
58 %! assert (prog_output_assert ("pass")); |
5590 | 59 |
60 %% test/octave.test/if/if-5.m | |
61 %!test | |
62 %! x = 0; | |
63 %! y = -2; | |
64 %! if (eye (2)) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
65 %! printf_assert ("fail\n"); |
5590 | 66 %! elseif (x) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
67 %! printf_assert ("fail\n"); |
5590 | 68 %! elseif (x) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
69 %! printf_assert ("fail\n"); |
5590 | 70 %! else |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
71 %! printf_assert ("pass\n"); |
5590 | 72 %! endif |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
73 %! assert (prog_output_assert ("pass")); |
5590 | 74 |
75 %% test/octave.test/if/if-6.m | |
76 %!test | |
77 %! x = 0; | |
78 %! y = -2; | |
79 %! if (y) | |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
80 %! printf_assert ("pass\n"); |
5590 | 81 %! elseif (x) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
82 %! printf_assert ("fail\n"); |
5590 | 83 %! elseif (x) |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
84 %! printf_assert ("fail\n"); |
5590 | 85 %! end |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
86 %! assert (prog_output_assert ("pass")); |
5590 | 87 |