X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.impure.lisp;h=06f52a51603237c96f5e634285a47e24aaa4a617;hb=9837343101c3da7b3a8f94609ec116ec5025436a;hp=ef9d8b076ed6a23f403af8d1d189e2474515d065;hpb=75f37cd646778cc8d4bed86d79309b7161bd41dc;p=sbcl.git diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index ef9d8b0..06f52a5 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1069,6 +1069,21 @@ (let ((usage-after (sb-kernel::dynamic-usage))) (when (< (+ usage-before 2000000) usage-after) (error "Leak"))))) + +;;; PROGV compilation and type checking when the declared type +;;; includes a FUNCTION subtype. +(declaim (type (or (function (t) (values boolean &optional)) string) + *hairy-progv-var*)) +(defvar *hairy-progv-var* #'null) +(with-test (:name :hairy-progv-type-checking) + (assert (eq :error + (handler-case + (progv '(*hairy-progv-var*) (list (eval 42)) + *hairy-progv-var*) + (type-error () :error)))) + (assert (equal "GOOD!" + (progv '(*hairy-progv-var*) (list (eval "GOOD!")) + *hairy-progv-var*)))) ;;;; tests not in the problem domain, but of the consistency of the ;;;; compiler machinery itself @@ -1820,18 +1835,4 @@ (setf *mystery* :mystery) (assert (eq :ok (test-mystery (make-thing :slot :mystery)))) -;;; PROGV compilation and type checking when the declared type -;;; includes a FUNCTION subtype. -(declaim (type (or (function (t) (values boolean &optional)) string) - *hairy-progv-var*)) -(defvar *hairy-progv-var* #'null) -(with-test (:name :hairy-progv-type-checking) - (assert (eq :error - (handler-case - (progv '(*hairy-progv-var*) (list (eval 42)) - *hairy-progv-var*) - (type-error () :error)))) - (assert (equal "GOOD!" - (progv '(*hairy-progv-var*) (list (eval "GOOD!")) - *hairy-progv-var*)))) ;;; success