X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fpackages.impure.lisp;h=0e782181ebe30e68e43786e07feae83da3b20fb1;hb=f10d937a07cb7198852694de95fd14858fccb5d3;hp=0d6e1943e93b914e46796b13209bb16c25c3a41f;hpb=46b1591074b5cf7611eeab0d1e4af7ee4e22ec94;p=sbcl.git diff --git a/tests/packages.impure.lisp b/tests/packages.impure.lisp index 0d6e194..0e78218 100644 --- a/tests/packages.impure.lisp +++ b/tests/packages.impure.lisp @@ -17,6 +17,11 @@ (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)) @@ -267,6 +272,11 @@ if a restart was invoked." (is (eq (sym "FOO" "SYM") (sym "BAZ" "SYM")))))) +(with-test (:name unintern.2) + (with-packages (("FOO" (:intern "SYM"))) + (unintern :sym "FOO") + (assert (find-symbol "SYM" "FOO")))) + ;;; WITH-PACKAGE-ITERATOR error signalling had problems (with-test (:name with-package-itarator.error) (assert (eq :good @@ -280,14 +290,17 @@ if a restart was invoked." :good))))) ;;; MAKE-PACKAGE error in another thread blocking FIND-PACKAGE & FIND-SYMBOL -#+sb-thread -(with-test (:name :bug-511072) +(with-test (:name :bug-511072 :skipped-on '(not :sb-thread)) (let* ((p (make-package :bug-511072)) - (sem (sb-thread:make-semaphore)) - (t2 (sb-thread:make-thread (lambda () - (handler-bind ((error (lambda (c) - (sb-thread:signal-semaphore sem) - (signal c)))) - (make-package :bug-511072)))))) - (sb-thread:wait-on-semaphore sem) - (assert (eq 'cons (read-from-string "CL:CONS"))))) + (sem1 (sb-thread:make-semaphore)) + (sem2 (sb-thread:make-semaphore)) + (t2 (make-join-thread (lambda () + (handler-bind ((error (lambda (c) + (sb-thread:signal-semaphore sem1) + (sb-thread:wait-on-semaphore sem2) + (abort c)))) + (make-package :bug-511072)))))) + (sb-thread:wait-on-semaphore sem1) + (with-timeout 10 + (assert (eq 'cons (read-from-string "CL:CONS")))) + (sb-thread:signal-semaphore sem2)))