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
d65009d6
Commit
d65009d6
authored
Dec 12, 2004
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored DESCRIBE tests
parent
72194dfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
68 deletions
+22
-68
ansi-tests/describe.lsp
ansi-tests/describe.lsp
+22
-68
No files found.
ansi-tests/describe.lsp
View file @
d65009d6
...
...
@@ -5,25 +5,27 @@
(in-package :cl-test)
(defun harness-for-describe (fn)
(let (s1 s2)
(with-open-stream
(*standard-output* (make-string-output-stream))
(with-open-stream
(tio-input (make-string-input-stream "X"))
(with-open-stream
(tio-output (make-string-output-stream))
(with-open-stream
(*terminal-io* (make-two-way-stream tio-input tio-output))
(let ((*print-circle* t)
(*print-readably* nil))
(assert (null (multiple-value-list (funcall fn))))))
(setq s2 (get-output-stream-string tio-output)))
(assert (equal (read-char tio-input) #\X)))
(setq s1 (get-output-stream-string *standard-output*)))
(values s1 s2)))
(deftest describe.1
(loop for x in *universe*
for s1 = nil
for s2 = nil
do
(with-open-stream
(*standard-output* (make-string-output-stream))
(with-open-stream
(tio-input (make-string-input-stream "X"))
(with-open-stream
(tio-output (make-string-output-stream))
(with-open-stream
(*terminal-io* (make-two-way-stream tio-input tio-output))
(let ((*print-circle* t)
(*print-readably* nil))
(assert (null (multiple-value-list (describe x))))))
(setq s2 (get-output-stream-string tio-output)))
(assert (equal (read-char tio-input) #\X)))
(setq s1 (get-output-stream-string *standard-output*)))
for (s1 s2) = (multiple-value-list (harness-for-describe #'(lambda () (describe x))))
when (and (equal s1 "") (equal s2 ""))
collect x)
nil)
...
...
@@ -32,69 +34,21 @@
(loop for x in *universe*
for s1 = nil
for s2 = nil
for s3 =
(with-output-to-string
(s)
(with-open-stream
(*standard-output* (make-string-output-stream))
(with-open-stream
(tio-input (make-string-input-stream "X"))
(with-open-stream
(tio-output (make-string-output-stream))
(with-open-stream
(*terminal-io* (make-two-way-stream tio-input tio-output))
(let ((*print-circle* t)
(*print-readably* nil))
(assert (null (multiple-value-list (describe x s))))))
(setq s2 (get-output-stream-string tio-output)))
(assert (equal (read-char tio-input) #\X)))
(setq s1 (get-output-stream-string *standard-output*))))
for s3 = (with-output-to-string (s) (setf (values s1 s2) (harness-for-describe #'(lambda () (describe x s)))))
when (or (equal s3 "") (not (equal "" s2)) (not (equal "" s1)))
collect (list x s1 s2 s3))
nil)
(deftest describe.3
(loop for x in *universe*
for s1 = nil
for s2 = nil
do
(with-open-stream
(*standard-output* (make-string-output-stream))
(with-open-stream
(tio-input (make-string-input-stream "X"))
(with-open-stream
(tio-output (make-string-output-stream))
(with-open-stream
(*terminal-io* (make-two-way-stream tio-input tio-output))
(let ((*print-circle* t)
(*print-readably* nil))
(assert (null (multiple-value-list (describe x t))))))
(setq s2 (get-output-stream-string tio-output)))
(assert (equal (read-char tio-input) #\X)))
(setq s1 (get-output-stream-string *standard-output*)))
for (s1 s2) = (multiple-value-list (harness-for-describe #'(lambda () (describe x t))))
when (or (equal "" s2) (not (equal "" s1)))
collect (list x s1 s2))
nil)
(deftest describe.4
(loop for x in *universe*
for s1 = nil
for s2 = nil
do
(with-open-stream
(*standard-output* (make-string-output-stream))
(with-open-stream
(tio-input (make-string-input-stream "X"))
(with-open-stream
(tio-output (make-string-output-stream))
(with-open-stream
(*terminal-io* (make-two-way-stream tio-input tio-output))
(let ((*print-circle* t)
(*print-readably* nil))
(assert (null (multiple-value-list (describe x nil))))))
(setq s2 (get-output-stream-string tio-output)))
(assert (equal (read-char tio-input) #\X)))
(setq s1 (get-output-stream-string *standard-output*)))
for (s1 s2) = (multiple-value-list (harness-for-describe #'(lambda () (describe x nil))))
when (or (equal "" s1) (not (equal "" s2)))
collect (list x s1 s2))
nil)
...
...
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