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
47834d61
Commit
47834d61
authored
Dec 10, 2004
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for DO-ALL-SYMBOLS
parent
6fc442d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
ansi-tests/do-all-symbols.lsp
ansi-tests/do-all-symbols.lsp
+74
-0
No files found.
ansi-tests/do-all-symbols.lsp
View file @
47834d61
...
...
@@ -9,3 +9,77 @@
(do-all-symbols (x)))
;;; FIXME Add tests for non-error cases
(deftest do-all-symbols.1
(let ((symbols nil))
(do-all-symbols (sym) (push sym symbols))
(let ((hash (make-hash-table :test 'eq)))
(with-package-iterator
(f (list-all-packages) :internal :external :inherited)
(loop
(multiple-value-bind (found sym) (f)
(unless found (return))
(setf (gethash sym hash) t))))
;; hash now contains all symbols accessible in any package
;; Check that all symbols from DO-ALL-SYMBOLS are in this
;; package
(loop for s in symbols unless (gethash s hash) collect s)))
nil)
;; This is the converse of do-all-symbols.1
(deftest do-all-symbols.2
(let ((symbols nil))
(with-package-iterator
(f (list-all-packages) :internal :external :inherited)
(loop
(multiple-value-bind (found sym) (f)
(unless found (return))`
(push sym symbols))))
(let ((hash (make-hash-table :test 'eq)))
(do-all-symbols (s) (setf (gethash s hash) t))
(loop for s in symbols unless (gethash s hash) collect s)))
nil)
(deftest do-all-symbols.3
(let ((sym (gensym)))
(do-all-symbols (s t) (assert (not (eq s sym)))))
t)
(deftest do-all-symbols.4
(let ((x :bad))
(do-all-symbols (x x)))
nil)
(deftest do-all-symbols.5
(block nil
(do-all-symbols (x (return :bad)))
:good)
:good)
(deftest do-all-symbols.6
(do-all-symbols (x :bad) (return :good))
:good)
(deftest do-all-symbols.7
(block done
(tagbody
(do-all-symbols (x (return-from done :good))
(go 1)
(return-from done :bad1)
1)
1
(return-from done :bad2)))
:good)
(deftest do-all-symbols.8
(block done
(tagbody
(do-all-symbols (x (return-from done :good))
(go tag)
(return-from done :bad1)
tag)
tag
(return-from done :bad2)))
:good)
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