X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdefstruct.impure.lisp;h=e1952867fd02118dd86b37529ea290084304f18d;hb=d76c81b0ca4dcfc99f0cd805f5c20493fa80b2b6;hp=ae949e97c6b5d5a02084f3fd55c5e85e696e38fb;hpb=25e76ec2b1083ac6a4bba42af7ad7b5a8239f2b8;p=sbcl.git diff --git a/tests/defstruct.impure.lisp b/tests/defstruct.impure.lisp index ae949e9..e195286 100644 --- a/tests/defstruct.impure.lisp +++ b/tests/defstruct.impure.lisp @@ -459,6 +459,23 @@ (assert (raises-error? (conc-name-nil-slot (make-conc-name-nil)) undefined-function)) +;;; The named/typed predicates were a little fragile, in that they +;;; could throw errors on innocuous input: +(defstruct (list-struct (:type list) :named) a-slot) +(assert (list-struct-p (make-list-struct))) +(assert (not (list-struct-p nil))) +(assert (not (list-struct-p 1))) +(defstruct (offset-list-struct (:type list) :named (:initial-offset 1)) a-slot) +(assert (offset-list-struct-p (make-offset-list-struct))) +(assert (not (offset-list-struct-p nil))) +(assert (not (offset-list-struct-p 1))) +(assert (not (offset-list-struct-p '(offset-list-struct)))) +(assert (not (offset-list-struct-p '(offset-list-struct . 3)))) +(defstruct (vector-struct (:type vector) :named) a-slot) +(assert (vector-struct-p (make-vector-struct))) +(assert (not (vector-struct-p nil))) +(assert (not (vector-struct-p #()))) + ;;; success (format t "~&/returning success~%") (quit :unix-status 104)