source: trunk/source/tests/ansi-tests/random-type-prop-tests-02.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 5.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Mar  6 20:37:57 2005
4;;;; Contains: Tests that invoke the random type prop infrastructure, part 2
5
6(in-package :cl-test)
7
8(def-type-prop-test =.1 '= '(number number) 2)
9(def-type-prop-test =.2 '= '(number number number) 3)
10(def-type-prop-test =.3 '= nil 4 :maxargs 10 :rest-type 'number)
11(def-type-prop-test =.4 '= '(integer integer) 2)
12(def-type-prop-test =.5 '= (list 'number #'(lambda (x) (if (coin) 'number
13                                                        `(eql ,x)))) 2)
14(def-type-prop-test =.6 '= (list 'number 'number
15                                 #'(lambda (x y) (rcase
16                                                  (2 'number)
17                                                  (1 `(eql ,x))
18                                                  (1 `(eql ,y)))))
19  3)
20(def-type-prop-test /=.1 '/= '(number number) 2)
21(def-type-prop-test /=.2 '/= '(number number number) 3)
22(def-type-prop-test /=.3 '/= nil 4 :maxargs 10 :rest-type 'number)
23(def-type-prop-test /=.4 '/= '(integer integer) 2)
24(def-type-prop-test /=.5 '/= (list 'number #'(lambda (x) (if (coin) 'number
25                                                           `(eql ,x)))) 2)
26(def-type-prop-test /=.6 '/= (list 'number 'number
27                                   #'(lambda (x y) (rcase
28                                                    (2 'number)
29                                                    (1 `(eql ,x))
30                                                    (1 `(eql ,y)))))
31  3)
32(def-type-prop-test <.1 '< '(real real) 2)
33(def-type-prop-test <.2 '< '(real real real) 3)
34(def-type-prop-test <.3 '< nil 4 :maxargs 10 :rest-type 'real)
35(def-type-prop-test <.4 '< '(integer integer) 2)
36(def-type-prop-test <.5 '< (list 'real #'(lambda (x) (if (coin) 'real
37                                                        `(eql ,x)))) 2)
38(def-type-prop-test <.6 '< (list 'real 'real
39                                 #'(lambda (x y) (rcase
40                                                  (2 'real)
41                                                  (1 `(eql ,x))
42                                                  (1 `(eql ,y)))))
43  3)
44(def-type-prop-test >.1 '> '(real real) 2)
45(def-type-prop-test >.2 '> '(real real real) 3)
46(def-type-prop-test >.3 '> nil 4 :maxargs 10 :rest-type 'real)
47(def-type-prop-test >.4 '> '(integer integer) 2)
48(def-type-prop-test >.5 '> (list 'real #'(lambda (x) (if (coin) 'real
49                                                        `(eql ,x)))) 2)
50(def-type-prop-test >.6 '> (list 'real 'real
51                                 #'(lambda (x y) (rcase
52                                                  (2 'real)
53                                                  (1 `(eql ,x))
54                                                  (1 `(eql ,y)))))
55  3)
56(def-type-prop-test <=.1 '<= '(real real) 2)
57(def-type-prop-test <=.2 '<= '(real real real) 3)
58(def-type-prop-test <=.3 '<= nil 4 :maxargs 10 :rest-type 'real)
59(def-type-prop-test <=.4 '<= '(integer integer) 2)
60(def-type-prop-test <=.5 '<= (list 'real #'(lambda (x) (if (coin) 'real
61                                                         `(eql ,x)))) 2)
62(def-type-prop-test <=.6 '<= (list 'real 'real
63                                   #'(lambda (x y) (rcase
64                                                    (2 'real)
65                                                    (1 `(eql ,x))
66                                                    (1 `(eql ,y)))))
67  3)
68(def-type-prop-test >=.1 '>= '(real real) 2)
69(def-type-prop-test >=.2 '>= '(real real real) 3)
70(def-type-prop-test >=.3 '>= nil 4 :maxargs 10 :rest-type 'real)
71(def-type-prop-test >=.4 '>= '(integer integer) 2)
72(def-type-prop-test >=.5 '>= (list 'real #'(lambda (x) (if (coin) 'real
73                                                         `(eql ,x)))) 2)
74(def-type-prop-test >=.6 '>= (list 'real 'real
75                                   #'(lambda (x y) (rcase
76                                                    (2 'real)
77                                                    (1 `(eql ,x))
78                                                    (1 `(eql ,y)))))
79  3)
80
81(def-type-prop-test min.1 'min nil 2 :maxargs 6 :rest-type 'integer)
82(def-type-prop-test min.2 'min nil 2 :maxargs 6 :rest-type 'rational)
83(def-type-prop-test min.3 'min nil 2 :maxargs 6 :rest-type 'real)
84(def-type-prop-test max.1 'max nil 2 :maxargs 6 :rest-type 'integer)
85(def-type-prop-test max.2 'max nil 2 :maxargs 6 :rest-type 'rational)
86(def-type-prop-test max.3 'max nil 2 :maxargs 6 :rest-type 'real)
87
88(def-type-prop-test minusp 'minusp '(real) 1)
89(def-type-prop-test plusp 'plusp '(real) 1)
90(def-type-prop-test zerop 'zerop '(number) 1)
91
92(def-type-prop-test floor.1 'floor '(real) 1)
93(def-type-prop-test floor.2 'floor '(real (and integer (not (satisfies zerop)))) 2)
94(def-type-prop-test floor.3 'floor '(real (and real (not (satisfies zerop)))) 2)
95(def-type-prop-test ffloor.1 'ffloor '(real) 1)
96(def-type-prop-test ffloor.2 'ffloor '(real (and integer (not (satisfies zerop)))) 2)
97(def-type-prop-test ffloor.3 'ffloor '(real (and real (not (satisfies zerop)))) 2)
98(def-type-prop-test ceiling.1 'ceiling '(real) 1)
99(def-type-prop-test ceiling.2 'ceiling '(real (and integer (not (satisfies zerop)))) 2)
100(def-type-prop-test ceiling.3 'ceiling '(real (and real (not (satisfies zerop)))) 2)
101(def-type-prop-test fceiling.1 'fceiling '(real) 1)
102(def-type-prop-test fceiling.2 'fceiling '(real (and integer (not (satisfies zerop)))) 2)
103(def-type-prop-test fceiling.3 'fceiling '(real (and real (not (satisfies zerop)))) 2)
104(def-type-prop-test truncate.1 'truncate '(real) 1)
105(def-type-prop-test truncate.2 'truncate '(real (and integer (not (satisfies zerop)))) 2)
106(def-type-prop-test truncate.3 'truncate '(real (and real (not (satisfies zerop)))) 2)
107(def-type-prop-test ftruncate.1 'ftruncate '(real) 1)
108(def-type-prop-test ftruncate.2 'ftruncate '(real (and integer (not (satisfies zerop)))) 2)
109(def-type-prop-test ftruncate.3 'ftruncate '(real (and real (not (satisfies zerop)))) 2)
110(def-type-prop-test round.1 'round '(real) 1)
111(def-type-prop-test round.2 'round '(real (and integer (not (satisfies zerop)))) 2)
112(def-type-prop-test round.3 'round '(real (and real (not (satisfies zerop)))) 2)
113(def-type-prop-test fround.1 'fround '(real) 1)
114(def-type-prop-test fround.2 'fround '(real (and integer (not (satisfies zerop)))) 2)
115(def-type-prop-test fround.3 'fround '(real (and real (not (satisfies zerop)))) 2)
Note: See TracBrowser for help on using the repository browser.