X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Freader.pure.lisp;h=d5407e4cb584bb70a6e952ec0f33de50db6247bf;hb=219cc40793f9c82fb943b29a1846f898f4f9de1e;hp=7f88b038bef886f14021b4481f36d9ab69db44e6;hpb=134fa6b3f7c5f4bb0652e74227d940a9e7a83563;p=sbcl.git diff --git a/tests/reader.pure.lisp b/tests/reader.pure.lisp index 7f88b03..d5407e4 100644 --- a/tests/reader.pure.lisp +++ b/tests/reader.pure.lisp @@ -245,3 +245,31 @@ (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))))) + +(with-test (:name set-syntax-from-char-dispatch-macro-char) + (let ((rt (copy-readtable))) + (make-dispatch-macro-character #\! nil rt) + (set-dispatch-macro-character #\! #\! (constantly 'bang^2) rt) + (flet ((maybe-bang () + (let ((*readtable* rt)) + (read-from-string "!!")))) + (assert (eq 'bang^2 (maybe-bang))) + (set-syntax-from-char #\! #\! rt) + (assert (eq '!! (maybe-bang))))))