aboutsummaryrefslogtreecommitdiff
path: root/tests/type.lisp
blob: d22913fac2c0bfc38c308e9faa4785e90d377041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(assert (list? (list 12 2 3)))
(assert (list? nil))
(assert (list? (list 1)))
(assert (not (list? 1)))
(assert (not (list? (cons 1 2))))
(assert (not (list? '(1 2 . 3))))

(assert (cons? (list 1 2 3)))
(assert (cons? '(1 2 . 3)))
(assert (not (cons? '())))

(assert (null? nil))
(assert (null? '()))
(assert (not (null? #f)))

(assert (number? 1))
(assert (number? 1))
(assert (number? 1.1))
(assert (float? 1.1))
(assert (float? (float 1)))
(assert (not (float? 1)))
(assert (not (integer? 1.1)))

(assert (atom? nil))
(assert (atom? #t))
(assert (atom? 'a))
(assert (atom? 1))
(assert (atom? 1.1))
(assert (atom? #\c))
(assert (atom? "hello"))
(assert (not (atom? (cons 1 2))))
(assert (lambda () 1))