X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fpprint.impure.lisp;h=32451bedf3816397018dacf9e0c198ca308fd9b9;hb=64ec717cf13c44fb4571c1fd7fbd508551ecfe01;hp=ee1f91a70a02c10c4f20b8d19eacc02261a178cf;hpb=2768ed83de59354b21ea61de3dea358c53d1ae05;p=sbcl.git diff --git a/tests/pprint.impure.lisp b/tests/pprint.impure.lisp index ee1f91a..32451be 100644 --- a/tests/pprint.impure.lisp +++ b/tests/pprint.impure.lisp @@ -88,6 +88,53 @@ ;2~%~ ;3x")))) +;;; bug 141b: not enough care taken to disambiguate ,.FOO and ,@FOO +;;; from , .FOO and , @FOO +(assert (equal + (with-output-to-string (s) + (write '`(, .foo) :stream s :pretty t :readably t)) + "`(, .FOO)")) +(assert (equal + (with-output-to-string (s) + (write '`(, @foo) :stream s :pretty t :readably t)) + "`(, @FOO)")) +(assert (equal + (with-output-to-string (s) + (write '`(, ?foo) :stream s :pretty t :readably t)) + "`(,?FOO)")) +;;; bug reported by Paul Dietz on sbcl-devel: unquoted lambda lists +;;; were leaking the SB-IMPL::BACKQ-COMMA implementation. +(assert (equal + (with-output-to-string (s) + (write '`(foo ,x) :stream s :pretty t :readably t)) + "`(FOO ,X)")) +(assert (equal + (with-output-to-string (s) + (write '`(foo ,@x) :stream s :pretty t :readably t)) + "`(FOO ,@X)")) +#+nil ; '`(foo ,.x) => '`(foo ,@x) apparently. +(assert (equal + (with-output-to-string (s) + (write '`(foo ,.x) :stream s :pretty t :readably t)) + "`(FOO ,.X)")) +(assert (equal + (with-output-to-string (s) + (write '`(lambda ,x) :stream s :pretty t :readably t)) + "`(LAMBDA ,X)")) +(assert (equal + (with-output-to-string (s) + (write '`(lambda ,@x) :stream s :pretty t :readably t)) + "`(LAMBDA ,@X)")) +#+nil ; see above +(assert (equal + (with-output-to-string (s) + (write '`(lambda ,.x) :stream s :pretty t :readably t)) + "`(LAMBDA ,.X)")) +(assert (equal + (with-output-to-string (s) + (write '`(lambda (,x)) :stream s :pretty t :readably t)) + "`(LAMBDA (,X))")) + ;;; success (quit :unix-status 104)