X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fmop.impure.lisp;h=28fccf3e17bcf4fe6c6abed8e8306cc5b50cc5f9;hb=905a0fc4c21ff6c8c752b9436e0616b868f1dfcc;hp=0cdefc6f9fe04062d3031cdcab7a8600702af6c8;hpb=760349abe9068fe4e5e3c03013f3533b64602a93;p=sbcl.git diff --git a/tests/mop.impure.lisp b/tests/mop.impure.lisp index 0cdefc6..28fccf3 100644 --- a/tests/mop.impure.lisp +++ b/tests/mop.impure.lisp @@ -376,6 +376,27 @@ (defclass tomato () ()) (assert (null (sb-mop:class-direct-subclasses (find-class 'vegetable)))) +;;; bug 331: lazy creation of clos classes for defstructs +(defstruct bug-331-super) +(defstruct (bug-331-sub (:include bug-331-super))) +(let ((subs (sb-mop:class-direct-subclasses (find-class 'bug-331-super)))) + (assert (= 1 (length subs))) + (assert (eq (car subs) (find-class 'bug-331-sub)))) + +;;; detection of multiple class options in defclass, reported by Bruno Haible +(defclass option-class (standard-class) + ((option :accessor cl-option :initarg :my-option))) +(defmethod sb-pcl:validate-superclass ((c1 option-class) (c2 standard-class)) + t) +(multiple-value-bind (result error) + (ignore-errors (eval '(defclass option-class-instance () + () + (:my-option bar) + (:my-option baz) + (:metaclass option-class)))) + (assert (not result)) + (assert error)) + ;;;; success (sb-ext:quit :unix-status 104)