1.0.43.29: fix OVERAGER-CHARACTER-BUFFERING test-case
[sbcl.git] / tests / reader.pure.lisp
index ed9743a..f0ba954 100644 (file)
 (assert (equal '((0 . "A") (1 . "B"))
                (coerce (read-from-string "#((0 . \"A\") (1 . \"B\"))")
                        'list)))
+
+;;; parse-integer uses whitespace[1] not whitespace[2] as its
+;;; definition of whitespace to skip.
+(let ((*readtable* (copy-readtable)))
+  (set-syntax-from-char #\7 #\Space)
+  (assert (= 710 (parse-integer "710"))))
+
+(let ((*readtable* (copy-readtable)))
+  (set-syntax-from-char #\7 #\Space)
+  (assert (string= (format nil "~7D" 1) "      1")))
+
+(let ((symbol (find-symbol "DOES-NOT-EXIST" "CL-USER")))
+  (assert (null symbol))
+  (handler-case
+      (read-from-string "CL-USER:DOES-NOT-EXIST")
+    (reader-error (c)
+      (princ c))))
+
+;;; The GET-MACRO-CHARACTER in SBCL <= "1.0.34.2" bogusly computed its
+;;; second return value relative to *READTABLE* rather than the passed
+;;; readtable.
+(let* ((*readtable* (copy-readtable nil)))
+  (set-syntax-from-char #\" #\A)
+  (multiple-value-bind (reader-fn non-terminating-p)
+      (get-macro-character #\" (copy-readtable nil))
+    (declare (ignore reader-fn))
+    (assert (not non-terminating-p))))
+
+(with-test (:name :bug-309093)
+  (assert (eq :error
+              (handler-case
+                  (read-from-string "`#2A((,(1+ 0) 0) (0 0))")
+                (reader-error ()
+                  :error)))))