2 (test (char= (code-char 127744) (code-char 127744)))
4 (test (not (char= #\A #\a)))
5 (test (not (char= #\d #\x)))
6 (test (not (char= #\d #\D)))
7 (test (not (char/= #\d #\d)))
8 (test (char/= #\d #\x))
9 (test (char/= #\d #\D))
10 (test (char= #\d #\d #\d #\d))
11 (test (not (char/= #\d #\d #\d #\d)))
12 (test (not (char= #\d #\d #\x #\d)))
13 (test (not (char/= #\d #\d #\x #\d)))
14 (test (not (char= #\d #\y #\x #\c)))
15 (test (char/= #\d #\y #\x #\c))
16 (test (not (char= #\d #\c #\d)))
17 (test (not (char/= #\d #\c #\d)))
18 (test (char< #\d #\x))
19 (test (char<= #\d #\x))
20 (test (not (char< #\d #\d)))
21 (test (char<= #\d #\d))
22 (test (char< #\a #\e #\y #\z))
23 (test (char<= #\a #\e #\y #\z))
24 (test (not (char< #\a #\e #\e #\y)))
25 (test (char<= #\a #\e #\e #\y))
26 (test (char> #\e #\d))
27 (test (char>= #\e #\d))
28 (test (char> #\d #\c #\b #\a))
29 (test (char>= #\d #\c #\b #\a))
30 (test (not (char> #\d #\d #\c #\a)))
31 (test (char>= #\d #\d #\c #\a))
32 (test (not (char> #\e #\d #\b #\c #\a)))
33 (test (not (char>= #\e #\d #\b #\c #\a)))
34 ;; (char> #\z #\A) => implementation-dependent
35 ;; (char> #\Z #\a) => implementation-dependent
36 (test (char-equal #\A #\a))
37 ;; (stable-sort (list #\b #\A #\B #\a #\c #\C) #'char-lessp) => (#\A #\a #\b #\B #\c #\C)
38 ;; (stable-sort (list #\b #\A #\B #\a #\c #\C) #'char<) => implementation-dependent
41 (test (equal #\a (character #\a)))
42 (test (equal #\a (character "a")))
43 ;; (test (equal #\A (character 'a)))
44 ;; (test (equal #\a (character '\a)))
45 ;; (expected-failure (character 65.))
46 ;; (expected-failure (character 'apple))
49 (test (characterp #\a))
50 (test (characterp (code-char 65)))
51 (test (char= #\A (code-char 65)))
52 (test (not (characterp 10)))
53 (test (not (characterp "a")))
54 (test (not (characterp "ab")))
55 (test (characterp (code-char 127744)))
56 ;; hyperspec examples:
57 (test (characterp #\a))
58 (test (not (characterp 'a)))
59 (test (not (characterp "a")))
60 (test (not (characterp 65.)))
61 ;; (test (characterp #\Newline))
64 (test (alpha-char-p #\a))
65 (test (not (alpha-char-p #\5)))
66 ;; (test (alpha-char-p #\Newline))
69 (test (alphanumericp #\Z))
70 (test (alphanumericp #\9))
71 ;; (test (not (alphanumericp #\Newline)))
72 (test (not (alphanumericp #\#)))
75 (test (char= #\0 (digit-char 0)))
76 (test (char= #\A (digit-char 10 11)))
77 (test (null (digit-char 10 10)))
78 (test (char= #\7 (digit-char 7)))
79 (test (null (digit-char 12)))
80 (test (char= #\C (digit-char 12 16))) ;; not #\c
81 (test (null (digit-char 6 2)))
82 (test (char= #\1 (digit-char 1 2)))
85 (test (= 5 (digit-char-p #\5)))
86 (test (null (digit-char-p #\5 2)))
87 (test (null (digit-char-p #\A)))
88 (test (null (digit-char-p #\a)))
89 (test (= 10 (digit-char-p #\A 11)))
90 (test (= 10 (digit-char-p #\a 11)))
91 ;; (mapcar #'(lambda (radix)
92 ;; (map 'list #'(lambda (x) (digit-char-p x radix))
97 (test (graphic-char-p #\G))
98 (test (graphic-char-p #\#))
99 ;; (test (graphic-char-p #\Space))
100 ;; (test (not (graphic-char-p #\Newline))
103 ;; (test (standard-char-p #\Space))
104 (test (standard-char-p #\~))
107 (test (char= #\A (char-upcase #\a)))
108 (test (char= #\A (char-upcase #\A)))
109 (test (char= (code-char 223) (char-upcase (code-char 223)))) ;; changes length, so you get the original back
110 (test (char= (code-char 127744) (char-upcase (code-char 127744)))) ;; no upper case
113 (test (char= #\a (char-downcase #\a)))
114 (test (char= #\a (char-downcase #\A)))
115 (test (char= (code-char 223) (char-downcase (code-char 223)))) ;; already lower case
116 (test (char= (code-char 127744) (char-downcase (code-char 127744)))) ;; no lower case
118 ;; UPPER-CASE-P, LOWER-CASE-P, BOTH-CASE-P
119 (test (upper-case-p #\A))
120 (test (not (upper-case-p #\a)))
121 (test (both-case-p #\a))
122 (test (not (both-case-p #\5)))
123 (test (not (lower-case-p #\5)))
124 (test (not (upper-case-p #\5)))
125 (test (not (upper-case-p (code-char 127744))))
127 ;; CODE-CHAR, CHAR-CODE
128 (test (char= #\A (code-char 65)))
129 (test (= 65 (char-code #\A)))
130 (test (= 127744 (char-code (code-char 127744))))
133 (test (= (char-int #\A) (char-int #\A))) ;; can be pretty much anything, as long as it's consistent
135 ;; CHAR-TO-STRING (not actually part of the characters dictionary)
136 (test (= 1 (string-length (char-to-string (code-char 127744)))))
139 (test (< 95 char-code-limit 10000000))
142 (test (string= "Space" (char-name #\ )))
143 ;; (test (string= "Space" (char-name #\Space)))
144 (test (string= "Page" (char-name (code-char 12)))) ;; #\Page
145 (test (string= "LATIN_SMALL_LETTER_A" (char-name #\a)))
146 (test (string= "LATIN_CAPITAL_LETTER_A" (char-name #\A)))
149 (test (char= #\ (name-char 'space))) ;; should be: #\Space
150 (test (char= #\ (name-char "space"))) ;; #\Space
151 (test (char= #\ (name-char "Space"))) ;; #\Space
153 (let ((x (char-name #\a)))
154 (or (not x) (eql (name-char x) #\a))))