2 (test (char= (code-char 127744) (code-char 127744)))
4 ;; TODO: char/=, char<, etc.
7 (test (equal #\a (character #\a)))
8 (test (equal #\a (character "a")))
9 ;; (test (equal #\A (character 'a)))
10 ;; (test (equal #\a (character '\a)))
11 ;; (expected-failure (character 65.))
12 ;; (expected-failure (character 'apple))
15 (test (characterp #\a))
16 (test (characterp (code-char 65)))
17 (test (char= #\A (code-char 65)))
18 (test (not (characterp 10)))
19 (test (not (characterp "a")))
20 (test (not (characterp "ab")))
21 (test (characterp (code-char 127744)))
22 ;; hyperspec examples:
23 (test (characterp #\a))
24 (test (not (characterp 'a)))
25 (test (not (characterp "a")))
26 (test (not (characterp 65.)))
27 ;; (test (characterp #\Newline))
30 (test (alpha-char-p #\a))
31 (test (not (alpha-char-p #\5)))
32 ;; (test (alpha-char-p #\Newline))
35 (test (alphanumericp #\Z))
36 (test (alphanumericp #\9))
37 ;; (test (not (alphanumericp #\Newline)))
38 (test (not (alphanumericp #\#)))
41 (test (char= #\0 (digit-char 0)))
42 (test (char= #\A (digit-char 10 11)))
43 (test (null (digit-char 10 10)))
44 (test (char= #\7 (digit-char 7)))
45 (test (null (digit-char 12)))
46 (test (char= #\C (digit-char 12 16))) ;; not #\c
47 (test (null (digit-char 6 2)))
48 (test (char= #\1 (digit-char 1 2)))
51 (test (= 5 (digit-char-p #\5)))
52 (test (null (digit-char-p #\5 2)))
53 (test (null (digit-char-p #\A)))
54 (test (null (digit-char-p #\a)))
55 (test (= 10 (digit-char-p #\A 11)))
56 (test (= 10 (digit-char-p #\a 11)))
57 ;; TODO: does the mapcar/lambda thing work here?
60 (test (graphic-char-p #\G))
61 (test (graphic-char-p #\#))
62 ;; (test (graphic-char-p #\Space))
63 ;; (test (not (graphic-char-p #\Newline))
66 ;; (test (standard-char-p #\Space))
67 (test (standard-char-p #\~))
70 (test (char= #\A (char-upcase #\a)))
71 (test (char= #\A (char-upcase #\A)))
72 (test (char= (code-char 223) (char-upcase (code-char 223)))) ;; changes length, so you get the original back
73 (test (char= (code-char 127744) (char-upcase (code-char 127744)))) ;; no upper case
76 (test (char= #\a (char-downcase #\a)))
77 (test (char= #\a (char-downcase #\A)))
78 (test (char= (code-char 223) (char-downcase (code-char 223)))) ;; already lower case
79 (test (char= (code-char 127744) (char-downcase (code-char 127744)))) ;; no lower case
81 ;; TODO: UPPER-CASE-P, LOWER-CASE-P, BOTH-CASE-P
83 ;; CODE-CHAR, CHAR-CODE
84 (test (char= #\A (code-char 65)))
85 (test (= 65 (char-code #\A)))
86 (test (= 127744 (char-code (code-char 127744))))
89 (test (= (char-int #\A) (char-int #\A))) ;; can be pretty much anything, as long as it's consistent
91 ;; CHAR-TO-STRING (not actually part of the characters dictionary)
92 (test (= 1 (string-length (char-to-string (code-char 127744)))))
95 (test (< 95 char-code-limit 10000000))
98 (test (string= "Space" (char-name #\ )))
99 ;; (test (string= "Space" (char-name #\Space)))
100 (test (string= "Page" (char-name (code-char 12)))) ;; #\Page
101 (test (string= "LATIN_SMALL_LETTER_A" (char-name #\a)))
102 (test (string= "LATIN_CAPITAL_LETTER_A" (char-name #\A)))
105 (test (char= #\ (name-char 'space))) ;; should be: #\Space
106 (test (char= #\ (name-char "space"))) ;; #\Space
107 (test (char= #\ (name-char "Space"))) ;; #\Space
109 (let ((x (char-name #\a)))
110 (or (not x) (eql (name-char x) #\a))))