From 4342e86a71e0e2f63bd4f9968265e07f29100ce2 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Wed, 7 Jul 2004 12:42:27 +0000 Subject: [PATCH] Another pprint-pop test, this time when pprint-logical-block is given NIL as the form being processed. --- ansi-tests/pprint-exit-if-list-exhausted.lsp | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/ansi-tests/pprint-exit-if-list-exhausted.lsp b/ansi-tests/pprint-exit-if-list-exhausted.lsp index 6f6261a5..361c5751 100644 --- a/ansi-tests/pprint-exit-if-list-exhausted.lsp +++ b/ansi-tests/pprint-exit-if-list-exhausted.lsp @@ -268,6 +268,39 @@ "[[1 . #1=(2 . #1#)]]" "[[1 . #1=(2 . #1#)]]") +;;; pprint-pop when pprint-logical-block is given NIL + +(deftest pprint-pop.9 + (flet ((%f (len) + (with-standard-io-syntax + (let ((*print-pretty* t) + (*print-escape* nil) + (*print-right-margin* 100) + (*print-readably* nil) + (*print-length* len)) + (with-output-to-string + (os) + (pprint-logical-block + (os nil :prefix "{" :suffix "}") + (let ((vals (multiple-value-list (pprint-pop)))) + (assert (equal vals '(nil)) () "First call returned ~A" vals)) + (write 1 :stream os) + (write #\Space :stream os) + (let ((vals (multiple-value-list (pprint-pop)))) + (assert (equal vals '(nil)) () "Second call returned ~A" vals)) + (write 2 :stream os) + (write #\Space :stream os) + (let ((vals (multiple-value-list (pprint-pop)))) + (assert (equal vals '(nil)) () "Third call returned ~A" vals)) + (write 3 :stream os) + )))))) + (values (%f nil) (%f 0) (%f 1) (%f 2) (%f 3) (%f 4))) + "{1 2 3}" + "{...}" + "{1 ...}" + "{1 2 ...}" + "{1 2 3}" + "{1 2 3}") ;;; Error cases -- GitLab