X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Freader.impure.lisp;h=84be1cf6979a806ecdb3c4ce6f56740952cb56c0;hb=fcde5281a74cb29e21550f4f979ad6356f149ab9;hp=23ccb4c4b2eb284679321308813b20fbe144026e;hpb=68c539ab90bb39f342229e68bf9286f63824597a;p=sbcl.git diff --git a/tests/reader.impure.lisp b/tests/reader.impure.lisp index 23ccb4c..84be1cf 100644 --- a/tests/reader.impure.lisp +++ b/tests/reader.impure.lisp @@ -13,14 +13,14 @@ ;;;; absolutely no warranty. See the COPYING and CREDITS files for ;;;; more information. -(in-package :cl-user) +(load "assertoid.lisp") +(use-package "ASSERTOID") ;;; Bug 30, involving mistakes in binding the read table, made this ;;; code fail. (defun read-vector (stream char) + (declare (ignorable char)) (coerce (read-delimited-list #\] stream t) 'vector)) -(set-syntax-from-char #\[ #\() ; do I really need this? -- MNA 2001-01-05 -(set-syntax-from-char #\] #\)) ; do I really need this? -- MNA 2001-01-05 (set-macro-character #\[ #'read-vector nil) (set-macro-character #\] (get-macro-character #\)) nil) (multiple-value-bind (res pos) @@ -36,5 +36,10 @@ (assert (equalp res #(#\x))) (assert (= pos 5))) +;;; Bug 51b. (try to throw READER-ERRORs when the reader encounters +;;; dubious input) +(assert (raises-error? (read-from-string "1e1000") reader-error)) +(assert (raises-error? (read-from-string "1/0") reader-error)) + ;;; success (quit :unix-status 104)