X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos-1.impure.lisp;h=dc00ae44aa43d0ed3e4b9676385a0da0b032f102;hb=e1905b479292158bd2bacdebb81e27b4da041097;hp=09b66f019ece7994ac5d140ea18e83fea824bea5;hpb=71922347ca66f2a3ad4c55092ccb3ad86a14c754;p=sbcl.git diff --git a/tests/clos-1.impure.lisp b/tests/clos-1.impure.lisp index 09b66f0..dc00ae4 100644 --- a/tests/clos-1.impure.lisp +++ b/tests/clos-1.impure.lisp @@ -87,3 +87,17 @@ (assert (raises-error? (funcall fun *foo*))) (assert (= 3 (b-of *foo*))) (assert (raises-error? (c-of *foo*))))) + +;; test that :documentation argument to slot specifiers are used as +;; the docstrings of accessor methods. +(defclass foo () + ((a :reader a-of :documentation "docstring for A") + (b :writer set-b-of :documentation "docstring for B") + (c :accessor c :documentation "docstring for C"))) + +(flet ((doc (fun) + (documentation fun t))) + (assert (string= (doc (find-method #'a-of nil '((foo)))) "docstring for A")) + (assert (string= (doc (find-method #'set-b-of nil '(t (foo)))) "docstring for B")) + (assert (string= (doc (find-method #'c nil '((foo)))) "docstring for C")) + (assert (string= (doc (find-method #'(setf c) nil '(t (foo)))) "docstring for C")))