X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Freader.pure.lisp;h=0d229334289d1b8afc61cd1ad5e9a9de7c614ef7;hb=079ef9dad558ca07cb8178ef428bf738112174fa;hp=be7f77c12c97f5a5156df32500cc166e6f58631c;hpb=0e43dbcc9599e1806d062703b69ebeb131a0f706;p=sbcl.git diff --git a/tests/reader.pure.lisp b/tests/reader.pure.lisp index be7f77c..0d22933 100644 --- a/tests/reader.pure.lisp +++ b/tests/reader.pure.lisp @@ -207,3 +207,24 @@ (unless fun (list char))))))) (let ((*readtable* (copy-readtable nil))) (assert (null (loop for c across standard-chars append (frob c))))))) + +;;; All these must return a primary value of NIL when *read-suppress* is T +;;; Reported by Bruno Haible on cmucl-imp 2004-10-25. +(let ((*read-suppress* t)) + (assert (null (read-from-string "(1 2 3)"))) + (assert (null (with-input-from-string (s "abc xyz)") + (read-delimited-list #\) s)))) + (assert (null (with-input-from-string (s "(1 2 3)") + (read-preserving-whitespace s)))) + (assert (null (with-input-from-string (s "(1 2 3)") + (read s))))) + +;;; EOF-ERROR-P defaults to true. Reported by Bruno Haible on +;;; cmucl-imp 2004-10-18. +(multiple-value-bind (res err) (ignore-errors (read-from-string "")) + (assert (not res)) + (assert (typep err 'end-of-file))) + +(assert (equal '((0 . "A") (1 . "B")) + (coerce (read-from-string "#((0 . \"A\") (1 . \"B\"))") + 'list)))