X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=73a68bbc172997ff11cd10871ad472ab92d664a2;hb=aebbc5aad31f7e55930c996a8c54f0a135e00894;hp=e3efc7281d75e9f14e92209dc45200944de84f70;hpb=e38cf29945f9ff0cfbf614c0c216be60e2515175;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index e3efc72..73a68bb 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -556,5 +556,20 @@ ;;; we should be able to make classes with uninterned names: (defclass #:class-with-uninterned-name () ()) +;;; SLOT-MISSING should be called when there are missing slots. +(defclass class-with-all-slots-missing () ()) +(defmethod slot-missing (class (o class-with-all-slots-missing) + slot-name op + &optional new-value) + op) +(assert (eq (slot-value (make-instance 'class-with-all-slots-missing) 'foo) + 'slot-value)) +(assert (eq (funcall (lambda (x) (slot-value x 'bar)) + (make-instance 'class-with-all-slots-missing)) + 'slot-value)) +(assert (eq (funcall (lambda (x) (setf (slot-value x 'baz) 'baz)) + (make-instance 'class-with-all-slots-missing)) + 'setf)) + ;;;; success (sb-ext:quit :unix-status 104)