describe: show the same information about functions for 'x and #'x.
[sbcl.git] / tests / full-eval.impure.lisp
index 98f345f..b2eb21a 100644 (file)
@@ -12,7 +12,7 @@
 ;;;; more information.
 
 #-sb-eval
-(sb-ext:quit :unix-status 104)
+(sb-ext:exit :code 104)
 
 (setf sb-ext:*evaluator-mode* :interpret)
 
           (assert (eql #c(1.0 2.0) (evaluated-struct-csingle *evaluated-struct*)))
           (assert (eql #c(2.0d0 3.0d0) (evaluated-struct-cdouble *evaluated-struct*))))))
 
+;;; Prior to 1.0.25, the interpreter checked for package lock
+;;; violation for a local function in the fbinding form's body's
+;;; lexical environment.
+(let ((sb-ext:*evaluator-mode* :interpret))
+  (assert
+   (ignore-errors
+     (eval
+      '(eql
+        (locally (declare (disable-package-locks
+                           ;; rather than create a whole new package
+                           ;; just to test this corner case, we'll
+                           ;; lexically shadow something innocuous in
+                           ;; the CL package.
+                           cl:ed))
+          (flet ((cl:ed ()
+                   42))
+            (declare (enable-package-locks cl:ed))
+            (cl:ed)))
+        42)))))
+
+(defvar *file* #p"full-eval-temp.lisp")
+(with-test (:name (:full-eval :redefinition-warnings))
+  (with-open-file (stream *file* :direction :output :if-exists :supersede)
+    (write '(defun function-for-redefinition () nil) :stream stream))
+  (handler-bind ((warning #'error))
+    (let ((sb-ext:*evaluator-mode* :interpret))
+      (load *file*)
+      (load *file*))
+    (let ((sb-ext:*evaluator-mode* :compile))
+      (load *file*))))
+(delete-file *file*)