X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=a00da1df408af4d23ed7d709bef654e7b91f90ca;hb=7976926f8112b708d5927a69923cf7a3dd003c55;hp=e08f7a7b584227e4a6646712227bace3eefa84f2;hpb=ab7aedfb1e4c0245814beb998e74e099b71092a6;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index e08f7a7..a00da1d 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1112,7 +1112,9 @@ (assert (= (method-on-defined-type-and-class 3) 4))))) ;; bug 281 -(let ((sb-pcl::*max-emf-precomputation-methods* 0)) +(let (#+nil ; no more sb-pcl::*max-emf-precomputation-methods* as of + ; sbcl-1.0.41.x + (sb-pcl::*max-emf-precomputation-methods* 0)) (eval '(defgeneric bug-281 (x) (:method-combination +) (:method ((x symbol)) 1) @@ -1862,4 +1864,37 @@ (cacheing-initargs-redefinitions-check-fun :slot2) (let ((thing (cacheing-initargs-redefinitions-check-fun :slot))) (assert (not (slot-boundp thing 'slot))))) + +(with-test (:name :defmethod-specializer-builtin-class-alias) + (let ((alias (gensym))) + (setf (find-class alias) (find-class 'symbol)) + (eval `(defmethod lp-618387 ((s ,alias)) + (symbol-name s))) + (assert (equal "FOO" (funcall 'lp-618387 :foo))))) + +(with-test (:name :pcl-spurious-ignore-warnings) + (defgeneric no-spurious-ignore-warnings (req &key key)) + (handler-bind ((warning (lambda (x) (error "~A" x)))) + (eval + '(defmethod no-spurious-ignore-warnings ((req number) &key key) + (declare (ignore key)) + (check-type req integer)))) + (defgeneric should-get-an-ignore-warning (req &key key)) + (let ((warnings 0)) + (handler-bind ((warning (lambda (c) (setq warnings 1) (muffle-warning c)))) + (eval '(defmethod should-get-an-ignore-warning ((req integer) &key key) + (check-type req integer)))) + (assert (= warnings 1)))) + +(defgeneric generic-function-pretty-arglist-optional-and-key (req &optional opt &key key) + (:method (req &optional opt &key key) + (list req opt key))) + +(with-test (:name :generic-function-pretty-arglist-optional-and-key) + (handler-bind ((warning #'error)) + ;; Used to signal a style-warning + (assert (equal '(req &optional opt &key key) + (sb-pcl::generic-function-pretty-arglist + #'generic-function-pretty-arglist-optional-and-key))))) + ;;;; success