source: trunk/source/tests/ansi-tests/random-type-prop-tests-04.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: 6.4 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Mar  6 21:44:41 2005
4;;;; Contains: Test that invoke the random type prop infrastructure, part 4
5
6(in-package :cl-test)
7
8(defun char-or-same (c &rest args)
9  (declare (ignore args))
10  (if (coin) `(eql ,c) 'character))
11
12(eval-when (:load-toplevel :execute) (compile 'char-or-same))
13
14(def-type-prop-test char=.1 'char= nil 2 :rest-type 'base-char :maxargs 5)
15(def-type-prop-test char=.2 'char= '(character character) 2)
16(def-type-prop-test char=.3 'char= (list 'character #'char-or-same) 2)
17(def-type-prop-test char=.4 'char= (list 'character #'char-or-same #'char-or-same) 3)
18(def-type-prop-test char=.5 'char= '(character) 3 :rest-type #'char-or-same :maxargs 6)
19
20(def-type-prop-test char/=.1 'char/= nil 2 :rest-type 'base-char :maxargs 5)
21(def-type-prop-test char/=.2 'char/= '(character character) 2)
22(def-type-prop-test char/=.3 'char/= (list 'character #'char-or-same) 2)
23(def-type-prop-test char/=.4 'char/= (list 'character 'character #'char-or-same) 3)
24(def-type-prop-test char/=.5 'char/= nil 2 :rest-type 'character :maxargs 6)
25
26(def-type-prop-test char<=.1 'char<= nil 2 :rest-type 'base-char :maxargs 5)
27(def-type-prop-test char<=.2 'char<= '(character character) 2)
28(def-type-prop-test char<=.3 'char<= (list 'character #'char-or-same) 2)
29(def-type-prop-test char<=.4 'char<= (list 'character #'char-or-same #'char-or-same) 3)
30(def-type-prop-test char<=.5 'char<= '(character) 3 :rest-type #'char-or-same :maxargs 6)
31
32(def-type-prop-test char>=.1 'char>= nil 2 :rest-type 'base-char :maxargs 5)
33(def-type-prop-test char>=.2 'char>= '(character character) 2)
34(def-type-prop-test char>=.3 'char>= (list 'character #'char-or-same) 2)
35(def-type-prop-test char>=.4 'char>= (list 'character #'char-or-same #'char-or-same) 3)
36(def-type-prop-test char>=.5 'char>= '(character) 3 :rest-type #'char-or-same :maxargs 6)
37
38(def-type-prop-test char<.1 'char< nil 2 :rest-type 'base-char :maxargs 5)
39(def-type-prop-test char<.2 'char< '(character character) 2)
40(def-type-prop-test char<.3 'char< (list 'character #'char-or-same) 2)
41(def-type-prop-test char<.4 'char< (list 'character 'character #'char-or-same) 3)
42(def-type-prop-test char<.5 'char< nil 2 :rest-type 'character :maxargs 6)
43
44(def-type-prop-test char>.1 'char> nil 2 :rest-type 'base-char :maxargs 5)
45(def-type-prop-test char>.2 'char> '(character character) 2)
46(def-type-prop-test char>.3 'char> (list 'character #'char-or-same) 2)
47(def-type-prop-test char>.4 'char> (list 'character 'character #'char-or-same) 3)
48(def-type-prop-test char>.5 'char> nil 2 :rest-type 'character :maxargs 6)
49
50
51(def-type-prop-test char-equal.1 'char-equal nil 2 :rest-type 'base-char :maxargs 5)
52(def-type-prop-test char-equal.2 'char-equal '(character character) 2)
53(def-type-prop-test char-equal.3 'char-equal (list 'character #'char-or-same) 2)
54(def-type-prop-test char-equal.4 'char-equal (list 'character #'char-or-same #'char-or-same) 3)
55(def-type-prop-test char-equal.5 'char-equal '(character) 3 :rest-type #'char-or-same :maxargs 6)
56
57(def-type-prop-test char-not-equal.1 'char-not-equal nil 2 :rest-type 'base-char :maxargs 5)
58(def-type-prop-test char-not-equal.2 'char-not-equal '(character character) 2)
59(def-type-prop-test char-not-equal.3 'char-not-equal (list 'character #'char-or-same) 2)
60(def-type-prop-test char-not-equal.4 'char-not-equal (list 'character 'character #'char-or-same) 3)
61(def-type-prop-test char-not-equal.5 'char-not-equal nil 2 :rest-type 'character :maxargs 6)
62
63(def-type-prop-test char-not-greaterp.1 'char-not-greaterp nil 2 :rest-type 'base-char :maxargs 5)
64(def-type-prop-test char-not-greaterp.2 'char-not-greaterp '(character character) 2)
65(def-type-prop-test char-not-greaterp.3 'char-not-greaterp (list 'character #'char-or-same) 2)
66(def-type-prop-test char-not-greaterp.4 'char-not-greaterp (list 'character #'char-or-same #'char-or-same) 3)
67(def-type-prop-test char-not-greaterp.5 'char-not-greaterp '(character) 3 :rest-type #'char-or-same :maxargs 6)
68
69(def-type-prop-test char-not-lessp.1 'char-not-lessp nil 2 :rest-type 'base-char :maxargs 5)
70(def-type-prop-test char-not-lessp.2 'char-not-lessp '(character character) 2)
71(def-type-prop-test char-not-lessp.3 'char-not-lessp (list 'character #'char-or-same) 2)
72(def-type-prop-test char-not-lessp.4 'char-not-lessp (list 'character #'char-or-same #'char-or-same) 3)
73(def-type-prop-test char-not-lessp.5 'char-not-lessp '(character) 3 :rest-type #'char-or-same :maxargs 6)
74
75(def-type-prop-test char-lessp.1 'char-lessp nil 2 :rest-type 'base-char :maxargs 5)
76(def-type-prop-test char-lessp.2 'char-lessp '(character character) 2)
77(def-type-prop-test char-lessp.3 'char-lessp (list 'character #'char-or-same) 2)
78(def-type-prop-test char-lessp.4 'char-lessp (list 'character 'character #'char-or-same) 3)
79(def-type-prop-test char-lessp.5 'char-lessp nil 2 :rest-type 'character :maxargs 6)
80
81(def-type-prop-test char-greaterp.1 'char-greaterp nil 2 :rest-type 'base-char :maxargs 5)
82(def-type-prop-test char-greaterp.2 'char-greaterp '(character character) 2)
83(def-type-prop-test char-greaterp.3 'char-greaterp (list 'character #'char-or-same) 2)
84(def-type-prop-test char-greaterp.4 'char-greaterp (list 'character 'character #'char-or-same) 3)
85(def-type-prop-test char-greaterp.5 'char-greaterp nil 2 :rest-type 'character :maxargs 6)
86
87(defun length1-p (seq) (= (length seq) 1))
88 
89(def-type-prop-test character 'character '((or character (and (string 1) (satisfies length1-p)))) 1)
90(def-type-prop-test characterp 'characterp '(t) 1)
91(def-type-prop-test alpha-char-p 'alpha-char-p '(character) 1)
92(def-type-prop-test alphanumericp 'alphanumericp '(character) 1)
93(def-type-prop-test digit-char 'digit-char '((or (integer 0 36) (integer 0)) (integer 2 36)) 1 :maxargs 2)
94(def-type-prop-test digit-char-p 'digit-char-p '(character) 1)
95(def-type-prop-test graphic-char-p 'graphic-char-p '(character) 1)
96(def-type-prop-test standard-char-p 'standard-char-p '(character) 1)
97(def-type-prop-test char-upcase 'char-upcase '(character) 1)
98(def-type-prop-test char-downcase 'char-downcase '(character) 1)
99(def-type-prop-test upper-case-p 'upper-case-p '(character) 1)
100(def-type-prop-test lower-case-p 'lower-case-p '(character) 1)
101(def-type-prop-test both-case-p 'both-case-p '(character) 1)
102(def-type-prop-test char-code 'char-code '(character) 1)
103(def-type-prop-test char-int 'char-int '(character) 1)
104(def-type-prop-test code-char 'code-char '((integer 0 #.char-code-limit)) 1)
105(def-type-prop-test char-name 'char-name '(character) 1)
106(def-type-prop-test name-char 'name-char '(string) 1)
107
Note: See TracBrowser for help on using the repository browser.