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
87240c0a
Commit
87240c0a
authored
20 years ago
by
pfdietz
Browse files
Options
Downloads
Patches
Plain Diff
More tests of pprint-dispatch
parent
617f0ae0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ansi-tests/pprint-dispatch.lsp
+54
-3
54 additions, 3 deletions
ansi-tests/pprint-dispatch.lsp
with
54 additions
and
3 deletions
ansi-tests/pprint-dispatch.lsp
+
54
−
3
View file @
87240c0a
...
...
@@ -188,10 +188,61 @@
(write-to-string '|Y|)))))
"X" nil "ABC" nil "ABC" "DEF")
;;; Funtion designators in pprint-dispatch
(defun pprint-dispatch-test-fn.1 (stream obj) (declare (ignore obj)) (write "ABC" :stream stream))
(defun pprint-dispatch-test-fn.2 (stream obj) (declare (ignore obj)) (write "DEF" :stream stream))
(deftest pprint-dispatch.9
(my-with-standard-io-syntax
(let ((*print-pprint-dispatch* (copy-pprint-dispatch nil))
(*print-readably* nil)
(*print-escape* nil)
(*print-pretty* t))
(values
(write-to-string '|X|)
(multiple-value-list (set-pprint-dispatch '(eql |X|) 'pprint-dispatch-test-fn.1))
(write-to-string '|X|)
(multiple-value-list (set-pprint-dispatch '(eql |X|) 'pprint-dispatch-test-fn.2))
(write-to-string '|X|))))
"X" (nil) "ABC" (nil) "DEF")
(deftest pprint-dispatch.10
(my-with-standard-io-syntax
(let ((*print-pprint-dispatch* (copy-pprint-dispatch nil))
(*print-readably* nil)
(*print-escape* nil)
(*print-pretty* t))
(let ((f #'(lambda (stream obj)
(declare (ignore obj))
(write "ABC" :stream stream)))
(g #'(lambda (stream obj)
(declare (ignore obj))
(write "DEF" :stream stream)))
(sym (gensym)))
(setf (symbol-function sym) f)
(values
(write-to-string '|X|)
(set-pprint-dispatch '(eql |X|) sym)
(write-to-string '|X|)
(progn
(setf (symbol-function sym) g)
(write-to-string '|X|))))))
"X" nil "ABC" "DEF")
;;; Error tests
(deftest pprint-dispatch.error.1
(signals-error (let ((*print-pprint-dispatch* (copy-pprint-dispatch nil)))
(pprint-dispatch))
program-error)
t)
(deftest pprint-dispatch.error.2
(signals-error (let ((*print-pprint-dispatch* (copy-pprint-dispatch nil)))
(pprint-dispatch nil nil nil))
program-error)
t)
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