X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=ae0fe96f8494b6fd9f98f40dab9c3c5fed940009;hb=b2decb8f7e46886dbb17c695d95c21c9e401fd07;hp=e6d6518fb38168431bca4811e4aebbf250445949;hpb=1217810e750e3e6b04641309fb8475eb5963e35e;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index e6d6518..ae0fe96 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1394,3 +1394,22 @@ (frob (x y) (position-if x y)) (frob (x y) (position-if-not x y)) (frob (x) (aref x 0))) + +(macrolet ((frob (style-warn-p form) + (if style-warn-p + `(catch :got-style-warning + (handler-case + (eval ',form) + (style-warning (e) (throw :got-style-warning nil))) + (error "missing style-warning for ~S" ',form)) + `(handler-case + (eval ',form) + (style-warning (e) + (error "bad style-warning for ~S: ~A" ',form e)))))) + (frob t (lambda (x &optional y &key z) (list x y z))) + (frob nil (lambda (x &optional y z) (list x y z))) + (frob nil (lambda (x &key y z) (list x y z))) + (frob t (defgeneric #:foo (x &optional y &key z))) + (frob nil (defgeneric #:foo (x &optional y z))) + (frob nil (defgeneric #:foo (x &key y z))) + (frob t (defun #:foo (x) (flet ((foo (x &optional y &key z) (list x y z))) (foo x x :z x)))))