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
40 ;; TODO: char/=, char<, etc.
43 (test (equal #\a (character #\a)))
44 (test (equal #\a (character "a")))
45 ;; (test (equal #\A (character 'a)))
46 ;; (test (equal #\a (character '\a)))
47 ;; (expected-failure (character 65.))
48 ;; (expected-failure (character 'apple))
51 (test (characterp #\a))
52 (test (characterp (code-char 65)))
53 (test (char= #\A (code-char 65)))
54 (test (not (characterp 10)))
55 (test (not (characterp "a")))
56 (test (not (characterp "ab")))
57 (test (characterp (code-char 127744)))
58 ;; hyperspec examples:
59 (test (characterp #\a))
60 (test (not (characterp 'a)))
61 (test (not (characterp "a")))
62 (test (not (characterp 65.)))
63 ;; (test (characterp #\Newline))
66 (test (alpha-char-p #\a))
67 (test (not (alpha-char-p #\5)))
68 ;; (test (alpha-char-p #\Newline))
71 (test (alphanumericp #\Z))
72 (test (alphanumericp #\9))
73 ;; (test (not (alphanumericp #\Newline)))
74 (test (not (alphanumericp #\#)))
77 (test (char= #\0 (digit-char 0)))
78 (test (char= #\A (digit-char 10 11)))
79 (test (null (digit-char 10 10)))
80 (test (char= #\7 (digit-char 7)))
81 (test (null (digit-char 12)))
82 (test (char= #\C (digit-char 12 16))) ;; not #\c
83 (test (null (digit-char 6 2)))
84 (test (char= #\1 (digit-char 1 2)))
87 (test (= 5 (digit-char-p #\5)))
88 (test (null (digit-char-p #\5 2)))
89 (test (null (digit-char-p #\A)))
90 (test (null (digit-char-p #\a)))
91 (test (= 10 (digit-char-p #\A 11)))
92 (test (= 10 (digit-char-p #\a 11)))
93 ;; TODO: does the mapcar/lambda thing work here?
96 (test (graphic-char-p #\G))
97 (test (graphic-char-p #\#))
98 ;; (test (graphic-char-p #\Space))
99 ;; (test (not (graphic-char-p #\Newline))
102 ;; (test (standard-char-p #\Space))
103 (test (standard-char-p #\~))
106 (test (char= #\A (char-upcase #\a)))
107 (test (char= #\A (char-upcase #\A)))
108 (test (char= (code-char 223) (char-upcase (code-char 223)))) ;; changes length, so you get the original back
109 (test (char= (code-char 127744) (char-upcase (code-char 127744)))) ;; no upper case
112 (test (char= #\a (char-downcase #\a)))
113 (test (char= #\a (char-downcase #\A)))
114 (test (char= (code-char 223) (char-downcase (code-char 223)))) ;; already lower case
115 (test (char= (code-char 127744) (char-downcase (code-char 127744)))) ;; no lower case
117 ;; TODO: UPPER-CASE-P, LOWER-CASE-P, BOTH-CASE-P
119 ;; CODE-CHAR, CHAR-CODE
120 (test (char= #\A (code-char 65)))
121 (test (= 65 (char-code #\A)))
122 (test (= 127744 (char-code (code-char 127744))))
125 (test (= (char-int #\A) (char-int #\A))) ;; can be pretty much anything, as long as it's consistent
127 ;; CHAR-TO-STRING (not actually part of the characters dictionary)
128 (test (= 1 (string-length (char-to-string (code-char 127744)))))
131 (test (< 95 char-code-limit 10000000))
134 (test (string= "Space" (char-name #\ )))
135 ;; (test (string= "Space" (char-name #\Space)))
136 (test (string= "Page" (char-name (code-char 12)))) ;; #\Page
137 (test (string= "LATIN_SMALL_LETTER_A" (char-name #\a)))
138 (test (string= "LATIN_CAPITAL_LETTER_A" (char-name #\A)))
141 (test (char= #\ (name-char 'space))) ;; should be: #\Space
142 (test (char= #\ (name-char "space"))) ;; #\Space
143 (test (char= #\ (name-char "Space"))) ;; #\Space
145 (let ((x (char-name #\a)))
146 (or (not x) (eql (name-char x) #\a))))