Commit 48a4d10f authored by pfdietz's avatar pfdietz
Browse files

Fix some typos

parent 36e28db2
...@@ -8,44 +8,51 @@ ...@@ -8,44 +8,51 @@
(in-package :cl-test) (in-package :cl-test)
(deftest print.cons.1 (deftest print.cons.1
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(|A|) :case :upcase :pretty nil :escape nil :readably nil)) (let ((*print-readably* nil))
(write-to-string '(|A|) :case :upcase :pretty nil :escape nil)))
"(A)") "(A)")
(deftest print.cons.2 (deftest print.cons.2
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(|A| |B|) :case :upcase :pretty nil :escape nil :readably nil)) (let ((*print-readably* nil))
(write-to-string '(|A| |B|) :case :upcase :pretty nil :escape nil)))
"(A B)") "(A B)")
(deftest print.cons.3 (deftest print.cons.3
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string (cons '|A| '|B|) :case :upcase :pretty nil :escape nil :readably nil)) (let ((*print-readably* nil))
(write-to-string (cons '|A| '|B|) :case :upcase :pretty nil :escape nil)))
"(A . B)") "(A . B)")
(deftest print.cons.4 (deftest print.cons.4
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string (let ((s '#:|X|)) (cons s s)) :case :upcase :pretty nil :escape t :readably nil)) (let ((*print-readably* nil))
(write-to-string (let ((s '#:|X|)) (cons s s)) :case :upcase :pretty nil :escape t)))
"(#:X . #:X)") "(#:X . #:X)")
(deftest print.cons.5 (deftest print.cons.5
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string (let ((s '#:|X|)) (cons s s)) :case :upcase :pretty nil :escape t :circle t :readably nil)) (let ((*print-readably* nil))
(write-to-string (let ((s '#:|X|)) (cons s s)) :case :upcase :pretty nil :escape t :circle t)))
"(#1=#:X . #1#)") "(#1=#:X . #1#)")
(deftest print.cons.6 (deftest print.cons.6
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string (let ((s1 (make-symbol "X")) (let ((*print-readably* nil))
(s2 (make-symbol "X"))) (write-to-string (let ((s1 (make-symbol "X"))
(list s1 s2 s1 s2)) (s2 (make-symbol "X")))
:case :upcase :pretty nil :escape t :circle t :readably nil)) (list s1 s2 s1 s2))
:case :upcase :pretty nil :escape t :circle t)))
"(#1=#:X #2=#:X #1# #2#)") "(#1=#:X #2=#:X #1# #2#)")
(deftest print.cons.7 (deftest print.cons.7
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string (let ((a (list 17 nil))) (let ((*print-readably* nil))
(setf (cdr a) a) (write-to-string (let ((a (list 17 nil)))
a) (setf (cdr a) a)
:circle t :pretty nil :escape nil :readably nil)) a)
:circle t :pretty nil :escape nil)))
"#1=(17 . #1#)") "#1=(17 . #1#)")
;;; Random printing ;;; Random printing
...@@ -63,7 +70,7 @@ ...@@ -63,7 +70,7 @@
(let ((x '`(a ,b ,@c (d . ,e) ,.f #(1 2 ,p ,@q ,.r s) g))) (let ((x '`(a ,b ,@c (d . ,e) ,.f #(1 2 ,p ,@q ,.r s) g)))
(loop (loop
repeat 20 repeat 20
nconc (randomly-check-readability x))) nconc (randomly-check-readability x :test #'is-similar)))
nil) nil)
;; random circular cons graphs ;; random circular cons graphs
...@@ -85,79 +92,85 @@ ...@@ -85,79 +92,85 @@
;;; Printing with *print-length* ;;; Printing with *print-length*
(deftest print.cons.length.1 (deftest print.cons.length.1
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(a) :length 0 :readably nil :pretty nil :escape nil)) (let ((*print-readably* nil))
(write-to-string '(a) :length 0 :pretty nil :escape nil)))
"(...)") "(...)")
(deftest print.cons.length.2 (deftest print.cons.length.2
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(81) :length 1 :readably nil :pretty nil :escape nil)) (let ((*print-readably* nil))
(write-to-string '(81) :length 1 :pretty nil :escape nil)))
"(81)") "(81)")
(deftest print.cons.length.3 (deftest print.cons.length.3
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(4 . 8) :length 1 :readably nil :pretty nil :escape nil)) (let ((*print-readably* nil))
(write-to-string '(4 . 8) :length 1 :pretty nil :escape nil)))
"(4 . 8)") "(4 . 8)")
(deftest print.cons.length.4 (deftest print.cons.length.4
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(4 8) :length 1 :readably nil :pretty nil :escape nil)) (let ((*print-readably* nil))
(write-to-string '(4 8) :length 1 :pretty nil :escape nil)))
"(4 ...)") "(4 ...)")
(deftest print.cons.length.5 (deftest print.cons.length.5
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(a b c d e f g h i j k l m n o p) (let ((*print-readably* nil))
:case :downcase :length 10 (write-to-string '(a b c d e f g h i j k l m n o p)
:readably nil :pretty nil :escape nil)) :case :downcase :length 10
:pretty nil :escape nil)))
"(a b c d e f g h i j ...)") "(a b c d e f g h i j ...)")
(deftest print.cons.length.6 (deftest print.cons.length.6
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(((((((0))))))) (let ((*print-readably* nil))
:case :downcase :length 3 (write-to-string '(((((((0)))))))
:readably nil :pretty nil :escape nil)) :case :downcase :length 3
:pretty nil :escape nil)))
"(((((((0)))))))") "(((((((0)))))))")
;;; Printing with *print-level* ;;; Printing with *print-level*
(deftest print.cons.level.1 (deftest print.cons.level.1
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(a) (let ((*print-readably* nil))
:case :downcase :level 0 (write-to-string '(a)
:readably nil :escape nil :case :downcase :level 0
:pretty nil)) :escape nil :pretty nil)))
"#") "#")
(deftest print.cons.level.2 (deftest print.cons.level.2
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(a) (let ((*print-readably* nil))
:case :downcase :level 1 (write-to-string '(a)
:readably nil :escape nil :case :downcase :level 1
:pretty nil)) :escape nil :pretty nil)))
"(a)") "(a)")
(deftest print.cons.level.3 (deftest print.cons.level.3
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '((a)) (let ((*print-readably* nil))
:case :downcase :level 1 (write-to-string '((a))
:readably nil :escape nil :case :downcase :level 1
:pretty nil)) :escape nil :pretty nil)))
"(#)") "(#)")
(deftest print.cons.level.4 (deftest print.cons.level.4
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(a) (let ((*print-readably* nil))
:case :downcase :level 2 (write-to-string '(a)
:readably nil :escape nil :case :downcase :level 2
:pretty nil)) :escape nil :pretty nil)))
"(a)") "(a)")
(deftest print.cons.level.5 (deftest print.cons.level.5
(with-standard-io-syntax (my-with-standard-io-syntax
(write-to-string '(#(a) #*1101 "abc") (let ((*print-readably* nil))
:case :downcase :level 1 (write-to-string '(#(a) #*1101 "abc")
:readably nil :pretty nil)) :case :downcase :level 1
:pretty nil)))
"(# #*1101 \"abc\")") "(# #*1101 \"abc\")")
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
(defmacro def-print-test (name form result &rest bindings) (defmacro def-print-test (name form result &rest bindings)
`(deftest ,name `(deftest ,name
(equalpt (equalpt
(with-standard-io-syntax (my-with-standard-io-syntax
(let ((*print-readably* nil)) (let ((*print-readably* nil))
(let ,bindings (let ,bindings
(with-output-to-string (*standard-output*) (prin1 ,form))))) (with-output-to-string (*standard-output*) (prin1 ,form)))))
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
(debug *random-read-check-debug*)) (debug *random-read-check-debug*))
(declare (type function test)) (declare (type function test))
;; Generate random printer-control values ;; Generate random printer-control values
(with-standard-io-syntax (my-with-standard-io-syntax
(let ((*print-array* (coin)) (let ((*print-array* (coin))
(*print-base* (+ 2 (random 34))) (*print-base* (+ 2 (random 34)))
(*print-radix* (coin)) (*print-radix* (coin))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment