X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Freader.impure.lisp;h=1db35cac17c3b7706e6b9d366c33f7e9f5523cb2;hb=HEAD;hp=81167f0654b3be2ef6f87b4e336850dd7bcca1bc;hpb=faf3b69d1062a987aa18d83459f60c4c8a8d0987;p=sbcl.git diff --git a/tests/reader.impure.lisp b/tests/reader.impure.lisp index 81167f0..1db35ca 100644 --- a/tests/reader.impure.lisp +++ b/tests/reader.impure.lisp @@ -125,7 +125,7 @@ (funcall fun) (assert (equal '(:ok) (read-from-string "{:ok)")))) -(with-test (:name bad-recursive-read) +(with-test (:name :bad-recursive-read) ;; This use to signal an unbound-variable error instead. (assert (eq :error (handler-case @@ -134,7 +134,7 @@ (reader-error (e) :error))))) -(with-test (:name standard-readtable-modified) +(with-test (:name :standard-readtable-modified) (macrolet ((test (form &optional op) `(assert (eq :error @@ -155,8 +155,18 @@ (test (make-dispatch-macro-character #\! t srt)) (test (set-dispatch-macro-character #\# #\a (constantly t) srt) 'set-dispatch-macro-character)))))) +(with-test (:name :reader-package-errors) + (flet ((test (string) + (handler-case + (progn (read-from-string string) :feh) + (error (e) + (when (and (typep e 'reader-error) (typep e 'package-error)) + (package-error-package e)))))) + (assert (equal "NO-SUCH-PKG" (test "no-such-pkg::foo"))) + (assert (eq (find-package :cl) (test "cl:no-such-sym"))))) + ;;; THIS SHOULD BE LAST as it frobs the standard readtable -(with-test (:name set-macro-character-nil) +(with-test (:name :set-macro-character-nil) (handler-bind ((sb-int:standard-readtable-modified-error #'continue)) (let ((fun (lambda (&rest args) 'ok))) ;; NIL means the standard readtable.