X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fpprint.impure.lisp;h=8423f9fdc276abfa1aa2492f9d265f025c125516;hb=782a45c5d5000d7e86c83e7b303f15270b1e03c2;hp=216c9e099312396a0d023c87837968f9bd54baa1;hpb=165bb53b405ab95ce76615ab77cee8284df0a36e;p=sbcl.git diff --git a/tests/pprint.impure.lisp b/tests/pprint.impure.lisp index 216c9e0..8423f9f 100644 --- a/tests/pprint.impure.lisp +++ b/tests/pprint.impure.lisp @@ -67,5 +67,41 @@ ;;; way to make an automated test: ;;; (LET ((*PRINT-CIRCLE* T)) (DESCRIBE (MAKE-HASH-TABLE))) +;;; bug 263: :PREFIX, :PER-LINE-PREFIX and :SUFFIX arguments of +;;; PPRINT-LOGICAL-BLOCK may be complex strings +(let ((list '(1 2 3)) + (prefix (make-array 2 + :element-type 'character + :displaced-to ";x" + :fill-pointer 1)) + (suffix (make-array 2 + :element-type 'character + :displaced-to ">xy" + :displaced-index-offset 1 + :fill-pointer 1))) + (assert (equal (with-output-to-string (s) + (pprint-logical-block (s list + :per-line-prefix prefix + :suffix suffix) + (format s "~{~W~^~:@_~}" list))) + (format nil ";1~%~ + ;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)")) + ;;; success (quit :unix-status 104)