X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Feval.impure.lisp;h=6900d74089bd8f068a11966e1f1ff1f2d1183a1a;hb=a647f35a48924c9bc1914e1286418309fc69704e;hp=a3db89d20cef29a46f106179dc1852adeeda36e7;hpb=37b5fc474cf0b4d739c12fc0356667a16006d217;p=sbcl.git diff --git a/tests/eval.impure.lisp b/tests/eval.impure.lisp index a3db89d..6900d74 100644 --- a/tests/eval.impure.lisp +++ b/tests/eval.impure.lisp @@ -220,4 +220,40 @@ (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))) + +#+sb-eval +(with-test (:name :bug-524707) + (let ((*evaluator-mode* :interpret) + (lambda-form '(lambda (x) (declare (fixnum x)) (1+ x)))) + (let ((fun (eval lambda-form))) + (assert (equal lambda-form (function-lambda-expression fun)))))) + ;;; success