8 |
;;; SUBTYPEP on rational types |
;;; SUBTYPEP on rational types |
9 |
|
|
10 |
(deftest subtypep.rational.1 |
(deftest subtypep.rational.1 |
11 |
(subtypep* '(rational 10 *) 'rational) |
(loop for tp1 in '((rational 10) (rational 10 *) |
12 |
t t) |
(rational 10 20) |
13 |
|
(rational (10) 20) |
14 |
|
(rational 10 (20)) |
15 |
|
(rational (10) (20)) |
16 |
|
(rational 10 1000000000000000) |
17 |
|
(rational (10)) (rational (10) *)) |
18 |
|
append |
19 |
|
(loop for tp2 in '(rational (rational) (rational *) |
20 |
|
(rational * *) (rational 10) (rational 10 *) |
21 |
|
(rational 0) (rational 0 *) |
22 |
|
(rational 19/2) (rational 19/2 *) |
23 |
|
(rational -1000000000000000) |
24 |
|
real (real) (real *) |
25 |
|
(real * *) (real 10) (real 10 *) |
26 |
|
(real 0) (real 0 *) |
27 |
|
(real 19/2) (real 19/2 *) |
28 |
|
(real -1000000000000000)) |
29 |
|
unless (equal (multiple-value-list |
30 |
|
(subtypep* tp1 tp2)) |
31 |
|
'(t t)) |
32 |
|
collect (list tp1 tp2))) |
33 |
|
nil) |
34 |
|
|
35 |
(deftest subtypep.rational.2 |
(deftest subtypep.rational.2 |
36 |
(subtypep* '(rational 10) 'rational) |
(loop for tp1 in '((rational * 10) |
37 |
t t) |
(rational 0 10) |
38 |
|
(rational 0 (10)) |
39 |
|
(rational (0) 10) |
40 |
|
(rational (0) (10)) |
41 |
|
(rational -1000000000000000 10) |
42 |
|
(rational * (10))) |
43 |
|
append |
44 |
|
(loop for tp2 in '(rational (rational) (rational *) |
45 |
|
(rational * *) (rational * 10) |
46 |
|
(rational * 21/2) |
47 |
|
(rational * 1000000000000000) |
48 |
|
real (real) (real *) |
49 |
|
(real * *) (real * 10) |
50 |
|
(real * 21/2) |
51 |
|
(real * 1000000000000000)) |
52 |
|
unless (equal (multiple-value-list |
53 |
|
(subtypep* tp1 tp2)) |
54 |
|
'(t t)) |
55 |
|
collect (list tp1 tp2))) |
56 |
|
nil) |
57 |
|
|
58 |
(deftest subtypep.rational.3 |
(deftest subtypep.rational.3 |
59 |
(subtypep* '(rational * 10) 'rational) |
(loop for tp1 in '((rational 10) (rational 10 *) |
60 |
t t) |
(rational 10 20) |
61 |
|
(rational 10 (21)) |
62 |
|
(rational 10 1000000000000000)) |
63 |
|
append |
64 |
|
(loop for tp2 in '((rational 11) (rational 11 *) |
65 |
|
(rational (10)) (rational (10) *) |
66 |
|
(integer 10) (integer 10 *) |
67 |
|
(real 11) |
68 |
|
(real (10)) |
69 |
|
(real 11 *) |
70 |
|
(real (10) *) |
71 |
|
(rational * (20)) |
72 |
|
(rational * 19) |
73 |
|
(real * (20)) |
74 |
|
(real * 19)) |
75 |
|
unless (equal (multiple-value-list |
76 |
|
(subtypep* tp1 tp2)) |
77 |
|
'(nil t)) |
78 |
|
collect (list tp1 tp2))) |
79 |
|
nil) |
80 |
|
|
81 |
(deftest subtypep.rational.4 |
(deftest subtypep.rational.4 |
82 |
(subtypep '(rational 10 20) 'rational) |
(loop for tp1 in '((rational * 10) |
83 |
t t) |
(rational 0 10) |
84 |
|
(rational (0) 10) |
85 |
|
(rational -1000000000000000 10)) |
86 |
|
append |
87 |
|
(loop for tp2 in '((rational * 9) |
88 |
|
(rational * (10)) |
89 |
|
(integer * 10) |
90 |
|
(real * 9) |
91 |
|
(real * (10))) |
92 |
|
unless (equal (multiple-value-list |
93 |
|
(subtypep* tp1 tp2)) |
94 |
|
'(nil t)) |
95 |
|
collect (list tp1 tp2))) |
96 |
|
nil) |
97 |
|
|
98 |
(deftest subtypep.rational.5 |
(deftest subtypep.rational.5 |
99 |
(subtypep '(rational (10) 20) 'rational) |
(check-equivalence |
100 |
t t) |
'(or (eql 0) (rational (0))) |
101 |
|
'(rational 0)) |
102 |
|
nil) |
103 |
|
|
104 |
(deftest subtypep.rational.6 |
(deftest subtypep.rational.6 |
105 |
(subtypep '(rational 10 (20)) 'rational) |
(check-equivalence |
106 |
t t) |
'(and (rational 0 10) (rational 5 15)) |
107 |
|
'(rational 5 10)) |
108 |
|
nil) |
109 |
|
|
110 |
(deftest subtypep.rational.7 |
(deftest subtypep.rational.7 |
111 |
(subtypep '(rational (10) (20)) 'rational) |
(check-equivalence |
112 |
t t) |
'(and (rational (0) 10) (rational 5 15)) |
113 |
|
'(rational 5 10)) |
114 |
|
nil) |
115 |
|
|
116 |
|
(deftest subtypep.rational.8 |
117 |
|
(check-equivalence |
118 |
|
'(and (rational 0 (10)) (rational 5 15)) |
119 |
|
'(rational 5 (10))) |
120 |
|
nil) |
121 |
|
|
122 |
|
(deftest subtypep.rational.9 |
123 |
|
(check-equivalence |
124 |
|
'(and (rational (0) (10)) (rational 5 15)) |
125 |
|
'(rational 5 (10))) |
126 |
|
nil) |
127 |
|
|
128 |
|
(deftest subtypep.rational.10 |
129 |
|
(check-equivalence |
130 |
|
'(and (rational 0 10) (rational (5) 15)) |
131 |
|
'(rational (5) 10)) |
132 |
|
nil) |
133 |
|
|
134 |
|
(deftest subtypep.rational.11 |
135 |
|
(check-equivalence |
136 |
|
'(and (rational 0 (10)) (rational (5) 15)) |
137 |
|
'(rational (5) (10))) |
138 |
|
nil) |
139 |
|
|
140 |
|
(deftest subtypep.rational.12 |
141 |
|
(check-equivalence |
142 |
|
'(and (rational 0 10) (not (rational (0) (10)))) |
143 |
|
'(member 0 10)) |
144 |
|
nil) |
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|