X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdefstruct.impure.lisp;h=9cdc9d0061d546fe0644aeda727c4efd58880551;hb=2b277125b2d14a05710d7c8e4c0a22f97eea662a;hp=14724d7771efccc865210f52d64700cda43ab002;hpb=d119bca6cc4e052fe6a043ce76a045713038b06f;p=sbcl.git diff --git a/tests/defstruct.impure.lisp b/tests/defstruct.impure.lisp index 14724d7..9cdc9d0 100644 --- a/tests/defstruct.impure.lisp +++ b/tests/defstruct.impure.lisp @@ -353,6 +353,29 @@ (assert (eql (manyraw-dd copy) #c(0.33 0.33))) (assert (eql (manyraw-ee copy) #c(0.44d0 0.44d0)))) +;;;; miscellaneous old bugs + +(defstruct ya-struct) +(when (ignore-errors (or (ya-struct-p) 12)) + (error "YA-STRUCT-P of no arguments should signal an error.")) +(when (ignore-errors (or (ya-struct-p 'too 'many 'arguments) 12)) + (error "YA-STRUCT-P of three arguments should signal an error.")) + +;;; bug 210: Until sbcl-0.7.8.32 BOA constructors had SAFETY 0 +;;; declared inside on the theory that slot types were already +;;; checked, which bogusly suppressed unbound-variable and other +;;; checks within the evaluation of initforms. +(defvar *bug210*) +(defstruct (bug210a (:constructor bug210a ())) + (slot *bug210*)) +(defstruct bug210b + (slot *bug210*)) +;;; Because of bug 210, this assertion used to fail. +(assert (typep (nth-value 1 (ignore-errors (bug210a))) 'unbound-variable)) +;;; Even with bug 210, these assertions succeeded. +(assert (typep (nth-value 1 (ignore-errors *bug210*)) 'unbound-variable)) +(assert (typep (nth-value 1 (ignore-errors (make-bug210b))) 'unbound-variable)) + ;;; success (format t "~&/returning success~%") (quit :unix-status 104)