0.6.10.10:
[sbcl.git] / tests / type.impure.lisp
1 (in-package :cl-user)
2
3 (let ((types '(character
4                integer fixnum (integer 0 10)
5                single-float (single-float -1.0 1.0) (single-float 0.1)
6                (real 4 8) (real -1 7) (real 2 11)
7                (member #\a #\b #\c) (member 1 #\a) (member 3.0 3.3))))
8   (dolist (i types)
9     (format t "type I=~S~%" i)
10     (dolist (j types)
11       (format t "  type J=~S~%" j)
12       (assert (subtypep i `(or ,i ,j)))
13       (assert (subtypep i `(or ,j ,i)))
14       (assert (subtypep i `(or ,i ,i ,j)))
15       (assert (subtypep i `(or ,j ,i))))))
16
17 (defun type-evidently-= (x y)
18   (and (subtypep x y)
19        (subtypep y x)))
20
21 (assert (subtypep 'single-float 'float))
22
23 (assert (type-evidently-= '(integer 0 10) '(or (integer 0 5) (integer 4 10))))
24
25 ;;; success
26 (quit :unix-status 104)