annotate test/test_set.m @ 7334:274d9642ac10 release-3-0-0

[project @ 2007-12-22 01:42:45 by jwe]
author jwe
date Sat, 22 Dec 2007 01:42:46 +0000
parents a1dbe9d80eee
children 83a8781b529d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 2006, 2007 John W. Eaton
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
2 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
3 ## This file is part of Octave.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
4 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
6 ## under the terms of the GNU General Public License as published by
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
8 ## your option) any later version.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
9 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
13 ## General Public License for more details.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
14 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
15 ## You should have received a copy of the GNU General Public License
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
17 ## <http://www.gnu.org/licenses/>.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5590
diff changeset
18
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
19 %% Automatically generated from DejaGNU files
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
20
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
21 %% test/octave.test/set/create_set-1.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
22 %!assert(all (all (create_set ([1, 2; 3, 4; 2, 4]) == [1, 2, 3, 4])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
23
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
24 %% test/octave.test/set/create_set-2.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
25 %!assert(all (all (create_set ([1; 2; 3; 4; 2; 4]) == [1, 2, 3, 4])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
26
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
27 %% test/octave.test/set/create_set-3.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
28 %!assert(isempty (create_set ([])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
29
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
30 %% test/octave.test/set/create_set-4.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
31 %!error create_set (1, 2);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
32
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
33 %% test/octave.test/set/union-1.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
34 %!assert(all (all (union ([1, 2, 4], [2, 3, 5]) == [1, 2, 3, 4, 5])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
35
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
36 %% test/octave.test/set/union-2.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
37 %!assert(all (all (union ([1; 2; 4], [2, 3, 5]) == [1, 2, 3, 4, 5])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
38
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
39 %% test/octave.test/set/union-3.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
40 %!assert(all (all (union ([1, 2, 3], [5; 7; 9]) == [1, 2, 3, 5, 7, 9])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
41
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
42 %% test/octave.test/set/union-4.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
43 %!error union (1);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
44
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
45 %% test/octave.test/set/union-5.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
46 %!error union (1, 2, 3);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
47
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
48 %% test/octave.test/set/intersection-1.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
49 %!assert(all (all (intersection ([1, 2, 3], [2, 3, 5]) == [2, 3])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
50
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
51 %% test/octave.test/set/intersection-2.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
52 %!assert(all (all (intersection ([1; 2; 3], [2, 3, 5]) == [2, 3])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
53
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
54 %% test/octave.test/set/intersection-3.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
55 %!assert(isempty (intersection ([1, 2, 3], [4; 5; 6])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
56
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
57 %% test/octave.test/set/intersection-4.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
58 %!error intersection (1);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
59
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
60 %% test/octave.test/set/intersection-5.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
61 %!error intersection (1, 2, 5);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
62
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
63 %% test/octave.test/set/complement-1.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
64 %!assert(all (all (complement ([1, 2, 3], [3; 4; 5; 6]) == [4, 5, 6])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
65
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
66 %% test/octave.test/set/complement-2.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
67 %!assert(all (all (complement ([1, 2, 3], [3, 4, 5, 6]) == [4, 5, 6])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
68
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
69 %% test/octave.test/set/complement-3.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
70 %!assert(isempty (complement ([1, 2, 3], [3, 2, 1])));
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
71
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
72 %% test/octave.test/set/complement-4.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
73 %!error complement (1);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
74
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
75 %% test/octave.test/set/complement-5.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
76 %!error complement (1, 2, 3);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
77