0.6.8.13:
[sbcl.git] / tests / compound-cons.impure.lisp
1 ;;;; ANSI requires CONS be supported as a compound type. The CMU CL
2 ;;;; version which SBCL was forked from didn't support this, but
3 ;;;; various patches made around May 2000 added support for this to
4 ;;;; CMU CL. This file contains tests of their functionality.
5
6 (cl:in-package :cl-user)
7
8 (declaim (optimize (debug 3) (speed 2) (space 1)))
9
10 ;;; None of this is going to work until SBCL is patched.
11 #|
12 (assert (not (typep 11 'cons)))
13 (assert (not (typep 11 '(cons *))))
14 (assert (not (typep 11 '(cons t t))))
15
16 (assert (not (typep '() 'cons)))
17 (assert (typep '(100) 'cons))
18 (assert (typep '(100) '(cons t)))
19 (assert (typep '(100) '(cons number)))
20 (assert (not (typep '(100) '(cons character))))
21 (assert (typep '(100) '(cons number t)))
22 (assert (typep '(100) '(cons number null)))
23 (assert (not (typep '(100) '(cons number string))))
24
25 (assert (typep '("yes" no) '(cons string symbol)))
26 (assert (not (typep '(yes no) '(cons string symbol))))
27 (assert (not (typep '(yes "no") '(cons string symbol))))
28 (assert (typep '(yes "no") '(cons symbol)))
29 (assert (typep '(yes "no") '(cons symbol t)))
30 (assert (typep '(yes "no") '(cons t string)))
31 (assert (not (typep '(yes "no") '(cons t null))))
32
33 (assert (subtypep '(cons t) 'cons))
34 (assert (subtypep 'cons '(cons t) ))
35 (assert (subtypep '(cons t *) 'cons))
36 (assert (subtypep 'cons '(cons t *) ))
37 (assert (subtypep '(cons * *) 'cons))
38 (assert (subtypep 'cons '(cons * *) ))
39
40 (assert (subtypep '(cons number *) 'cons ))
41 (assert (not (subtypep 'cons '(cons number *))))
42 (assert (subtypep '(cons * number) 'cons ))
43 (assert (not (subtypep 'cons '(cons * number))))
44 (assert (subtypep '(cons structure-object number) 'cons ))
45 (assert (not (subtypep 'cons '(cons structure-object number))))
46
47 (assert (subtypep '(cons null fixnum) (type-of '(nil 44))))
48 |#
49
50 (sb-ext:quit :unix-status 104) ; success