1.0.46.43: fix sb-introspect on non-threaded builds
[sbcl.git] / tests / character.pure.lisp
index 1a35bbb..e26fed4 100644 (file)
       (let ((coded-char-name (char-name coded-char)))
         (assert (string= name coded-char-name))))))
 
+;;; Trivial tests for some unicode names
+#+sb-unicode
+(dolist (d '(("LATIN_CAPITAL_LETTER_A" 65)
+             ("LATIN_SMALL_LETTER_A" 97)
+             ("LATIN_SMALL_LETTER_CLOSED_OPEN_E" 666)
+             ("DIGRAM_FOR_GREATER_YIN" 9871)))
+  (destructuring-bind (name code) d
+    (assert (eql (code-char code) (name-char (string-downcase name))))
+    (assert (equal name (char-name (code-char code))))))
+
 ;;; bug 230: CHAR= didn't check types of &REST arguments
 (dolist (form '((code-char char-code-limit)
                 (standard-char-p "a")
          (name (char-name char)))
     (unless graphicp
       (assert name))))
+
+(assert (null (name-char 'foo)))
+
+;;; Between 1.0.4.53 and 1.0.4.69 character untagging was broken on
+;;; x86-64 if the result of the VOP was allocated on the stack, failing
+;;; an aver in the compiler.
+(with-test (:name :character-untagging)
+  (compile nil
+           '(lambda (c0 c1 c2 c3 c4 c5 c6 c7
+                     c8 c9 ca cb cc cd ce cf)
+             (declare (type character c0 c1 c2 c3 c4 c5 c6 c7
+                       c8 c9 ca cb cc cd ce cf))
+             (char< c0 c1 c2 c3 c4 c5 c6 c7
+              c8 c9 ca cb cc cd ce cf))))