1.0.42.25: check parent-lambdas in defined-fun-functional
[sbcl.git] / tests / packages.impure.lisp
index b2421b2..db5c3b2 100644 (file)
 (assert (eq *foo* (find-package "")))
 (assert (delete-package ""))
 
+(make-package "BAR")
+(defvar *baz* (rename-package "BAR" "BAZ"))
+(assert (eq *baz* (find-package "BAZ")))
+(assert (delete-package *baz*))
+
 (handler-case
     (export :foo)
   (package-error (c) (princ c))
@@ -245,6 +250,17 @@ if a restart was invoked."
       (is (eql 1 (length conflict-sets)))
       (is (eql 3 (length (first conflict-sets)))))))
 
+;;; Make sure that resolving a name-conflict in IMPORT doesn't leave
+;;; multiple symbols of the same name in the package (this particular
+;;; scenario found in 1.0.38.9, but clearly a longstanding issue).
+(with-test (:name import-conflict-resolution)
+  (with-packages (("FOO" (:export "NIL"))
+                  ("BAR" (:use)))
+    (with-name-conflict-resolution ((sym "FOO" "NIL"))
+      (import (list 'CL:NIL (sym "FOO" "NIL")) "BAR"))
+    (do-symbols (sym "BAR")
+      (assert (eq sym (sym "FOO" "NIL"))))))
+
 ;;; UNINTERN
 (with-test (:name unintern.1)
   (with-packages (("FOO" (:export "SYM"))