Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Karsten Poeck
ansi-test
Commits
9aef3bce
Commit
9aef3bce
authored
Apr 21, 2004
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify vector printing tests so that specialized vectors don't necessarily have to print readably.
parent
229f4126
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
ansi-tests/print-vector.lsp
ansi-tests/print-vector.lsp
+7
-3
ansi-tests/printer-aux.lsp
ansi-tests/printer-aux.lsp
+10
-2
No files found.
ansi-tests/print-vector.lsp
View file @
9aef3bce
...
...
@@ -252,7 +252,9 @@
when (vectorp v)
nconc
(loop repeat 10
nconc (randomly-check-readability v :test #'equalp)))
nconc (randomly-check-readability
v :test #'equalp
:can-fail (not (subtypep t (array-element-type v))))))
nil)
(deftest print.vector.random.2
...
...
@@ -262,7 +264,8 @@
:initial-contents '(1 3 2 0))
nconc
(loop repeat 10
nconc (randomly-check-readability v :test #'equalp)))
nconc (randomly-check-readability v :test #'equalp
:can-fail t)))
nil)
(deftest print.vector.random.3
...
...
@@ -272,7 +275,8 @@
:initial-contents '(-1 1 0 -2))
nconc
(loop repeat 10
nconc (randomly-check-readability v :test #'equalp)))
nconc (randomly-check-readability v :test #'equalp
:can-fail t)))
nil)
;;; *print-length* checks
...
...
ansi-tests/printer-aux.lsp
View file @
9aef3bce
...
...
@@ -23,6 +23,7 @@
;;; argument TEST is used to compared the reread object and obj.
(defun randomly-check-readability (obj &key
(can-fail nil)
(test #'equal)
(readable t)
(escape nil escape-p)
...
...
@@ -51,10 +52,17 @@
(readcase (random-from-seq #(:upcase :downcase :preserve :invert)))
)
(setf (readtable-case *readtable*) readcase)
(let* ((str (with-output-to-string (s) (write obj :stream s)))
(let* ((str (handler-case
(with-output-to-string (s) (write obj :stream s))
(print-not-readable
()
(if can-fail
(return-from randomly-check-readability nil)
":print-not-readable-error"))))
(obj2 (let ((*read-base* *print-base*))
(handler-case
(let ((*readtable* (if *print-readably* (copy-readtable nil)
(let ((*readtable* (if *print-readably*
(copy-readtable nil)
*readtable*)))
(read-from-string str))
(reader-error () :error)))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment