Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ansi-test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michał Herda
ansi-test
Commits
48a4d10f
Commit
48a4d10f
authored
20 years ago
by
pfdietz
Browse files
Options
Downloads
Patches
Plain Diff
Fix some typos
parent
36e28db2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansi-tests/print-cons.lsp
+75
-62
75 additions, 62 deletions
ansi-tests/print-cons.lsp
ansi-tests/printer-aux.lsp
+2
-2
2 additions, 2 deletions
ansi-tests/printer-aux.lsp
with
77 additions
and
64 deletions
ansi-tests/print-cons.lsp
+
75
−
62
View file @
48a4d10f
...
@@ -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\")")
This diff is collapsed.
Click to expand it.
ansi-tests/printer-aux.lsp
+
2
−
2
View file @
48a4d10f
...
@@ -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))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment