diff --git a/ansi-tests/load-printer.lsp b/ansi-tests/load-printer.lsp index f4668198966da67b137627a996310079658d1d71..ff43d6d91ffa8afc47bfac4c59fa4d99729a796e 100644 --- a/ansi-tests/load-printer.lsp +++ b/ansi-tests/load-printer.lsp @@ -17,6 +17,7 @@ (load "print-symbols.lsp") (load "print-strings.lsp") (load "print-cons.lsp") +(load "print-backquote.lsp") (load "print-bit-vector.lsp") (load "print-vector.lsp") (load "print-array.lsp") diff --git a/ansi-tests/print-backquote.lsp b/ansi-tests/print-backquote.lsp new file mode 100644 index 0000000000000000000000000000000000000000..2f07e0c66bca81da1ac6a55809e8ed8cfc729806 --- /dev/null +++ b/ansi-tests/print-backquote.lsp @@ -0,0 +1,128 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Thu Jun 10 19:31:01 2004 +;;;; Contains: Tests of printing of backquote forms (and fragments thereof) + +(in-package :cl-test) + +(compile-and-load "printer-aux.lsp") + +(deftest print.backquote.random.1 + (let* ((x '`(a ,b ,@c (d . ,e) ,.f #(1 2 ,p ,@q ,.r s) g)) + (y (copy-tree x))) + (or + (loop + repeat 20 + nconc (randomly-check-readability y :test #'is-similar)) + (and (not (equal x y)) (list :modified x y)))) + nil) + +(deftest print.backquote.random.2 + (let* ((x '`(,@a ,@b)) + (y (copy-tree x))) + (or + (loop + repeat 20 + nconc (randomly-check-readability y :test #'is-similar)) + (and (not (is-similar x y)) (list :modified x y)))) + nil) + +(deftest print.backquote.random.3 + (let* ((x '`(,.a ,.b)) + (y (copy-tree x))) + (or + (loop + repeat 20 + nconc (randomly-check-readability y :test #'is-similar)) + (and (not (is-similar x y)) (list :modified x y)))) + nil) + +(deftest print.backquote.random.4 + (let* ((x '`(,a ,b)) + (y (copy-tree x))) + (or + (loop + repeat 20 + nconc (randomly-check-readability y :test #'is-similar)) + (and (not (is-similar x y)) (list :modified x y)))) + nil) + +(deftest print.backquote.random.5 + (let* ((x '`#(,a ,b)) + (y (copy-tree x))) + (or + (loop + repeat 20 + nconc (randomly-check-readability y :test #'is-similar)) + (and (not (is-similar x y)) (list :modified x y)))) + nil) + +(deftest print.backquote.random.6 + (let ((x '`(,@a ,@b))) + (and (consp x) + (symbolp (car x)) + (loop + repeat 20 + nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) + nil) + +(deftest print.backquote.random.7 + (let ((x '`(,.a ,.b))) + (and (consp x) + (symbolp (car x)) + (loop + repeat 20 + nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) + nil) + +(deftest print.backquote.random.8 + (let ((x '`(,a ,b))) + (and (consp x) + (symbolp (car x)) + (loop + repeat 20 + nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) + nil) + +(deftest print.backquote.random.9 + (let ((x '`#(,a ,b))) + (and (consp x) + (symbolp (car x)) + (loop + repeat 20 + nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) + nil) + +(deftest print.backquote.random.10 + (let ((x '`#(,a , .b))) + (loop + repeat 20 + nconc (randomly-check-readability x :test #'is-similar))) + nil) + +(deftest print.backquote.random.11 + (let ((x '`#(,a , @b))) + (loop + repeat 20 + nconc (randomly-check-readability x :test #'is-similar))) + nil) + +(deftest print.backquote.random.12 + (let ((x '`#(,a ,b c))) + (and (consp x) + (symbolp (car x)) + (loop + repeat 20 + nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) + nil) + +(deftest print.backquote.random.13 + (let* ((x '`#(,a ,b c)) + (y (copy-tree x))) + (or + (loop + repeat 20 + nconc (randomly-check-readability x :test #'is-similar)) + (and (not (is-similar x y)) (list :modified x y)))) + nil) + diff --git a/ansi-tests/print-cons.lsp b/ansi-tests/print-cons.lsp index 4b91a671a6fff01c3ec475e39628fc3380d20820..d72f0bb814ea35c9e5ac2e465b95b74f831e6db7 100644 --- a/ansi-tests/print-cons.lsp +++ b/ansi-tests/print-cons.lsp @@ -66,107 +66,6 @@ 10) nil) -(deftest print.backquote.random.1 - (let ((x '`(a ,b ,@c (d . ,e) ,.f #(1 2 ,p ,@q ,.r s) g))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.2 - (let ((x '`(,@a ,@b))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.3 - (let ((x '`(,.a ,.b))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.4 - (let ((x '`(,a ,b))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.5 - (let ((x '`#(,a ,b))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.6 - (let ((x '`(,@a ,@b))) - (and (consp x) - (symbolp (car x)) - (loop - repeat 20 - nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) - nil) - -(deftest print.backquote.random.7 - (let ((x '`(,.a ,.b))) - (and (consp x) - (symbolp (car x)) - (loop - repeat 20 - nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) - nil) - -(deftest print.backquote.random.8 - (let ((x '`(,a ,b))) - (and (consp x) - (symbolp (car x)) - (loop - repeat 20 - nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) - nil) - -(deftest print.backquote.random.9 - (let ((x '`#(,a ,b))) - (and (consp x) - (symbolp (car x)) - (loop - repeat 20 - nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) - nil) - -(deftest print.backquote.random.10 - (let ((x '`#(,a , .b))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.11 - (let ((x '`#(,a , @b))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - -(deftest print.backquote.random.12 - (let ((x '`#(,a ,b c))) - (and (consp x) - (symbolp (car x)) - (loop - repeat 20 - nconc (randomly-check-readability (list (car x)) :test #'is-similar)))) - nil) - -(deftest print.backquote.random.13 - (let ((x '`#(,a ,b c))) - (loop - repeat 20 - nconc (randomly-check-readability x :test #'is-similar))) - nil) - ;; random circular cons graphs (deftest print.cons.random.2 (loop repeat 50