X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fsmoke.impure.lisp;h=d5e86b3b8710f2dbed09aae45a6e40de89ff8954;hb=22c1de0a40df83bb5628974010a879cb2c17ff53;hp=ee750cd6c832a3c4dfaae1533135dd75ef1a1525;hpb=648b48d2406f6d6f2bf341bf8ed350aac85398d0;p=sbcl.git diff --git a/tests/smoke.impure.lisp b/tests/smoke.impure.lisp index ee750cd..d5e86b3 100644 --- a/tests/smoke.impure.lisp +++ b/tests/smoke.impure.lisp @@ -37,5 +37,27 @@ (loop repeat 100000 do (profiled-fun)) (report) +;;; DEFCONSTANT should behave as the documentation specifies, +;;; including documented condition type. +(defun oidentity (x) x) +(defconstant +const+ 1) +(assert (= (oidentity +const+) 1)) +(let ((error (nth-value 1 (ignore-errors (defconstant +const+ 2))))) + (assert (typep error 'sb-ext:defconstant-uneql)) + (assert (= (sb-ext:defconstant-uneql-old-value error) 1)) + (assert (= (sb-ext:defconstant-uneql-new-value error) 2)) + (assert (eql (sb-ext:defconstant-uneql-name error) '+const+))) +(assert (= (oidentity +const+) 1)) +(handler-bind + ((sb-ext:defconstant-uneql + (lambda (c) (abort c)))) + (defconstant +const+ 3)) +(assert (= (oidentity +const+) 1)) +(handler-bind + ((sb-ext:defconstant-uneql + (lambda (c) (continue c)))) + (defconstant +const+ 3)) +(assert (= (oidentity +const+) 3)) + ;;; success (quit :unix-status 104)