X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Feval.impure.lisp;h=c79066a816c02e4e527dae3c64dbc031d84d56ee;hb=007bcd5aac2f3a1e714563bd39f7a2db2d0bf7c2;hp=a3db89d20cef29a46f106179dc1852adeeda36e7;hpb=37b5fc474cf0b4d739c12fc0356667a16006d217;p=sbcl.git diff --git a/tests/eval.impure.lisp b/tests/eval.impure.lisp index a3db89d..c79066a 100644 --- a/tests/eval.impure.lisp +++ b/tests/eval.impure.lisp @@ -220,4 +220,33 @@ (tagbody (go NIL) NIL) t) (assert (tagbody-nil-is-valid-tag)))) +;;; top-level DECLARE is formally undefined, but we want it to raise +;;; an error rather than silently return NIL. +(defvar *scratch*) +(with-test (:name :toplevel-declare) + (assert (raises-error? (eval '(declare (type pathname *scratch*)))))) + +(with-test (:name (eval no-compiler-notes)) + (handler-bind ((sb-ext:compiler-note #'error)) + (let ((sb-ext:*evaluator-mode* :compile)) + (eval '(let ((x 42)) + (if nil x))) + (eval '(let ((* 13)) + (let ((x 42) + (y *)) + (declare (optimize speed)) + (+ x y))))))) + +(with-test (:name :bug-238) + (let ((sb-ext:*evaluator-mode* :compile)) + (handler-bind ((sb-ext:compiler-note #'error)) + (eval '(defclass bug-238 () ())) + (eval '(defmethod bug-238 ((x bug-238) (bug-238 bug-238)) + (call-next-method))) + (eval '(handler-case + (with-input-from-string (*query-io* " no") + (yes-or-no-p)) + (simple-type-error () 'error))) + t))) + ;;; success