X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcharacters.lisp;h=74679f6f00487f4595cb3330eaeb76a5de598b75;hb=7fed10780b69c3892b33d665b547afa70943adf2;hp=9ec833d895b0f4930d819d86e665b13afb99acaf;hpb=b3cadbfd3e3bb702dadc08a1cf1d57bde4da29bd;p=jscl.git diff --git a/tests/characters.lisp b/tests/characters.lisp index 9ec833d..74679f6 100644 --- a/tests/characters.lisp +++ b/tests/characters.lisp @@ -33,12 +33,10 @@ (test (not (char>= #\e #\d #\b #\c #\a))) ;; (char> #\z #\A) => implementation-dependent ;; (char> #\Z #\a) => implementation-dependent -;; (test (char-equal #\A #\a)) +(test (char-equal #\A #\a)) ;; (stable-sort (list #\b #\A #\B #\a #\c #\C) #'char-lessp) => (#\A #\a #\b #\B #\c #\C) ;; (stable-sort (list #\b #\A #\B #\a #\c #\C) #'char<) => implementation-dependent -;; TODO: char/=, char<, etc. - ;; CHARACTER (test (equal #\a (character #\a))) (test (equal #\a (character "a"))) @@ -90,7 +88,10 @@ (test (null (digit-char-p #\a))) (test (= 10 (digit-char-p #\A 11))) (test (= 10 (digit-char-p #\a 11))) -;; TODO: does the mapcar/lambda thing work here? +;; (mapcar #'(lambda (radix) +;; (map 'list #'(lambda (x) (digit-char-p x radix)) +;; "059AaFGZ")) +;; '(2 8 10 16 36)) ;; GRAPHIC-CHAR-P (test (graphic-char-p #\G)) @@ -114,7 +115,14 @@ (test (char= (code-char 223) (char-downcase (code-char 223)))) ;; already lower case (test (char= (code-char 127744) (char-downcase (code-char 127744)))) ;; no lower case -;; TODO: UPPER-CASE-P, LOWER-CASE-P, BOTH-CASE-P +;; UPPER-CASE-P, LOWER-CASE-P, BOTH-CASE-P +(test (upper-case-p #\A)) +(test (not (upper-case-p #\a))) +(test (both-case-p #\a)) +(test (not (both-case-p #\5))) +(test (not (lower-case-p #\5))) +(test (not (upper-case-p #\5))) +(test (not (upper-case-p (code-char 127744)))) ;; CODE-CHAR, CHAR-CODE (test (char= #\A (code-char 65))) @@ -124,8 +132,7 @@ ;; CHAR-INT (test (= (char-int #\A) (char-int #\A))) ;; can be pretty much anything, as long as it's consistent -;; CHAR-TO-STRING (not actually part of the characters dictionary) -(test (= 1 (string-length (char-to-string (code-char 127744))))) +(test (= 1 (length (string (code-char 127744))))) ;; CHAR-CODE-LIMIT (test (< 95 char-code-limit 10000000))