1.0.44.36: test case for bug #681092
[sbcl.git] / tests / eval.impure.lisp
index c5de28b..6900d74 100644 (file)
 (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