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
50a61794
Commit
50a61794
authored
19 years ago
by
pfdietz
Browse files
Options
Downloads
Patches
Plain Diff
Move typep tests to their own file
parent
da94481b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ansi-tests/type.lsp
+9
-2
9 additions, 2 deletions
ansi-tests/type.lsp
ansi-tests/typep.lsp
+113
-0
113 additions, 0 deletions
ansi-tests/typep.lsp
ansi-tests/types-and-class.lsp
+0
-119
0 additions, 119 deletions
ansi-tests/types-and-class.lsp
with
122 additions
and
121 deletions
ansi-tests/type.lsp
+
9
−
2
View file @
50a61794
...
...
@@ -59,6 +59,13 @@
collect (list x class form val))
nil)
;;; Free TYPE declaration
;;; It should not apply to the occurence of X in the form
;;; whose value is being bound to Y.
(deftest type.6
(let ((x 2))
(let ((y (+ (decf x) 2)))
(declare (type (integer 0 1) x))
(values x y)))
1 3)
This diff is collapsed.
Click to expand it.
ansi-tests/typep.lsp
+
113
−
0
View file @
50a61794
...
...
@@ -33,3 +33,116 @@
(signals-error-always (typep nil '(function () t)) error)
t t)
;;; Non-error tests
;;; Many more tests use typep when testing other functions
(deftest typep-nil-null
(notnot-mv (typep nil 'null))
t)
(deftest typep-t-null
(typep t 'null)
nil)
;;; Tests of env arguments to typep
(deftest typep.env.1
(notnot-mv (typep 0 'bit nil))
t)
(deftest typep.env.2
(macrolet ((%foo (&environment env)
(notnot-mv (typep 0 'bit env))))
(%foo))
t)
(deftest typep.env.3
(macrolet ((%foo (&environment env)
(notnot-mv (typep env (type-of env)))))
(%foo))
t)
;;; Other typep tests
(deftest typep.1
(notnot-mv (typep 'a '(eql a)))
t)
(deftest typep.2
(notnot-mv (typep 'a '(and (eql a))))
t)
(deftest typep.3
(notnot-mv (typep 'a '(or (eql a))))
t)
(deftest typep.4
(typep 'a '(eql b))
nil)
(deftest typep.5
(typep 'a '(and (eql b)))
nil)
(deftest typep.6
(typep 'a '(or (eql b)))
nil)
(deftest typep.7
(notnot-mv (typep 'a '(satisfies symbolp)))
t)
(deftest typep.8
(typep 10 '(satisfies symbolp))
nil)
(deftest typep.9
(let ((class (find-class 'symbol)))
(notnot-mv (typep 'a class)))
t)
(deftest typep.10
(let ((class (find-class 'symbol)))
(notnot-mv (typep 'a `(and ,class))))
t)
(deftest typep.11
(let ((class (find-class 'symbol)))
(typep 10 class))
nil)
(deftest typep.12
(let ((class (find-class 'symbol)))
(typep 10 `(and ,class)))
nil)
(deftest typep.13
(typep 'a '(and symbol integer))
nil)
(deftest typep.14
(notnot-mv (typep 'a '(or symbol integer)))
t)
(deftest typep.15
(notnot-mv (typep 'a '(or integer symbol)))
t)
(deftest typep.16
(let ((c1 (find-class 'number))
(c2 (find-class 'symbol)))
(notnot-mv (typep 'a `(or ,c1 ,c2))))
t)
(deftest typep.17
(let ((c1 (find-class 'number))
(c2 (find-class 'symbol)))
(notnot-mv (typep 'a `(or ,c2 ,c1))))
t)
(deftest typep.18
(let ((i 0))
(values
(notnot (typep (incf i) '(and (integer 0 10) (integer -5 6))))
i))
t 1)
This diff is collapsed.
Click to expand it.
ansi-tests/types-and-class.lsp
+
0
−
119
View file @
50a61794
...
...
@@ -23,14 +23,6 @@
(check-type-predicate 'is-t-or-nil 'boolean)
0)
;; Two type inclusions on booleans
;; have been conditionalized to prevent
;; some tests from doing too badly on CMU CL on x86
;; These should get removed when I get a more up to date
;; image for that platform -- pfd
(deftest types.3
(loop
for (t1 t2) in *subtype-table*
...
...
@@ -241,15 +233,6 @@
(notnot-mv (macro-function 'deftype))
t)
(deftest typep-nil-null
(notnot-mv (typep nil 'null))
t)
(deftest typep-t-null
(typep t 'null)
nil)
;;; Error checking of type-related functions
(deftest type-error-datum.error.1
...
...
@@ -277,105 +260,3 @@
program-error)
t)
;;; Tests of env arguments to typep
(deftest typep.env.1
(notnot-mv (typep 0 'bit nil))
t)
(deftest typep.env.2
(macrolet ((%foo (&environment env)
(notnot-mv (typep 0 'bit env))))
(%foo))
t)
(deftest typep.env.3
(macrolet ((%foo (&environment env)
(notnot-mv (typep env (type-of env)))))
(%foo))
t)
;;; Other typep tests
(deftest typep.1
(notnot-mv (typep 'a '(eql a)))
t)
(deftest typep.2
(notnot-mv (typep 'a '(and (eql a))))
t)
(deftest typep.3
(notnot-mv (typep 'a '(or (eql a))))
t)
(deftest typep.4
(typep 'a '(eql b))
nil)
(deftest typep.5
(typep 'a '(and (eql b)))
nil)
(deftest typep.6
(typep 'a '(or (eql b)))
nil)
(deftest typep.7
(notnot-mv (typep 'a '(satisfies symbolp)))
t)
(deftest typep.8
(typep 10 '(satisfies symbolp))
nil)
(deftest typep.9
(let ((class (find-class 'symbol)))
(notnot-mv (typep 'a class)))
t)
(deftest typep.10
(let ((class (find-class 'symbol)))
(notnot-mv (typep 'a `(and ,class))))
t)
(deftest typep.11
(let ((class (find-class 'symbol)))
(typep 10 class))
nil)
(deftest typep.12
(let ((class (find-class 'symbol)))
(typep 10 `(and ,class)))
nil)
(deftest typep.13
(typep 'a '(and symbol integer))
nil)
(deftest typep.14
(notnot-mv (typep 'a '(or symbol integer)))
t)
(deftest typep.15
(notnot-mv (typep 'a '(or integer symbol)))
t)
(deftest typep.16
(let ((c1 (find-class 'number))
(c2 (find-class 'symbol)))
(notnot-mv (typep 'a `(or ,c1 ,c2))))
t)
(deftest typep.17
(let ((c1 (find-class 'number))
(c2 (find-class 'symbol)))
(notnot-mv (typep 'a `(or ,c2 ,c1))))
t)
(deftest typep.18
(let ((i 0))
(values
(notnot (typep (incf i) '(and (integer 0 10) (integer -5 6))))
i))
t 1)
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