4 /* There are more tests for every and some in rtestnset; these tests mainly
5 check these functions with matrix arguments. */
13 emptyp(matrix([],[]));
19 every('integerp, matrix());
22 some('integerp, matrix());
25 every("<", matrix([]));
28 every("=", matrix([],[]));
31 some("<", matrix([]));
34 some("=", matrix([],[]));
37 some("=",[[x],a],[x,b]);
40 every("=",[[x],a],[x,b]);
43 some(identity, [false,true]);
46 every(identity, [false,true]);
49 every(integerp, matrix([6,2],[7,21]));
52 some(integerp, matrix([6,2],[7,21]));
55 every(integerp, matrix([6,2],[7,%pi]));
58 some(integerp, matrix([6,2],[7,%pi]));
61 every(lambda([x], x < 1), matrix([-7,0],[-5,-13]));
64 every(lambda([x], x < 1), matrix([-7,0],[5,13]));
67 some(lambda([x], x < 1), matrix([-7,0],[5,13]));
70 (booleanp(x) := is (x = 'true) or is (x = 'false),0);
73 every('booleanp, matrix([false],[true]));
76 every('booleanp, matrix([false],[45]));
79 some('booleanp, matrix([false],[true]));
82 some('booleanp, matrix([false],[45]));
85 every("=", matrix([a,b],[c,d]), matrix([a,b],[c,d]));
88 every("=", matrix([a,b],[c,d]), matrix([a,b],[c,29]));
91 every('ratnump, genmatrix(lambda([i,j],1/(i+j)),101,103));
94 some('integerp, genmatrix(lambda([i,j],1/(i+j)),101,92));
97 (allrats(x) := if mapatom(x) then ratnump(x) else every('allrats, args(x)),0);
100 every('allrats, matrix([matrix([4,5],[6,7]), matrix([8,9],[7,z])]));
103 every('allrats, [[[5,19/3],[],[1,2]]]);
106 (somerats(x) := if mapatom(x) then ratnump(x) else some('somerats, args(x)),0);
109 some('somerats, matrix([matrix([4,5],[6,7]), matrix([8,9],[7,z])]));
112 some('somerats, [[[u,[1/2],[],[n,k]]]]);
115 some('somerats, [[[u,[%pi-%e],[],[n,k]]]]);
118 some(listp,matrix([a]));
121 some(integerp, [ [ 1 , 2 ] ] );
124 every(matrixp,matrix([matrix([a])]));
133 every(listp, [ [ ] ] );
136 every(listp, [ [ a ] ] );
139 errcatch(some(listp,a[1]));
142 errcatch(every(listp,a[1]));
145 errcatch(some(numberp,a[1]));
148 errcatch(some(listp,a[[x]]));
151 errcatch(some(integerp,f[1](2)));
154 some("<",[%i,3],[2,7]);
157 some("<",[%i,3],[2,-7]);
160 every("<",[%i,3],[2,7]);
163 every("<",[%i,3],[2,-7]);
166 (saveprederror : prederror, prederror : false,0);
169 some('maybe,[6<5,a<b]);
178 some('identity, [unknown, false]);
181 every('identity, [unknown, false]);
184 (betweenp(a,b,c) := (a-b)*(c-b) < 0,0);
187 every('betweenp, matrix([1,2],[5,6]), matrix([2,3],[6,7]), matrix([3,4],[7,8]));
190 some('betweenp, matrix([1,2],[5,6]), matrix([2,3],[6,7]), matrix([3,u],[n,k]));
193 every('betweenp, matrix([1,2],[5,6]), matrix([2,3],[6,7]), matrix([3,u],[n,k]));
196 some('identity,set(a,b,c));
199 every('identity,set(a,b,c));
202 some("<", [%i,2],[1,5]);
205 every("<", [%i,2],[1,5]);
208 some("<",[a,b],[c,d]);
211 every("<",[a,b],[c,d]);
214 (prederror : true,0);
217 some('maybe,[6<5,a<b]);
226 some('identity,set(a,b,c));
229 every('identity,set(a,b,c));
232 some("<", [%i,2],[1,5]);
235 every("<", [%i,2],[1,5]);
238 some("<",[a,b],[c,d]);
241 every("<",[a,b],[c,d]);
244 every('betweenp, matrix([1,2],[5,6]), matrix([2,3],[6,7]), matrix([3,u],[n,k]));
247 (prederror : saveprederror,0);
250 (remvalue(saveprederror),0);
253 (remfunction(betweenp, booleanp, allrats, somerats),0);