X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fmop.impure.lisp;h=28fccf3e17bcf4fe6c6abed8e8306cc5b50cc5f9;hb=b914788eab773b579664dcdc09a5278161191c47;hp=ddc2e9b05afe40ddb3cd7500cfd0d1eac8e95ab1;hpb=f4e8bca5eaa6e6db42299fe2f3852fb2e07508c7;p=sbcl.git diff --git a/tests/mop.impure.lisp b/tests/mop.impure.lisp index ddc2e9b..28fccf3 100644 --- a/tests/mop.impure.lisp +++ b/tests/mop.impure.lisp @@ -369,6 +369,34 @@ (assert (null value)) (assert (typep error 'error))))) +;;; bug reported by David Morse: direct-subclass update protocol was broken +(defclass vegetable () ()) +(defclass tomato (vegetable) ()) +(assert (equal (list (find-class 'tomato)) (sb-mop:class-direct-subclasses (find-class 'vegetable)))) +(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)