1 ;; Tests for list functions
3 ;; TODO: EQUAL doesn't compare lists correctly at the moment.
4 ;; Once it does the lists can be compared directly in many of these tests
7 (test (let* ((foo (list '(1 2) '(3 4)))
9 ;; (SETF (CAR (CAR FOO)) 0) doesn't work in the test for some reason,
10 ;; despite working fine in the REPL
12 (not (= (car (car foo))
16 (test (tree-equal '(1 2 3) '(1 2 3)))
17 (test (tree-equal '(1 (2 (3 4) 5) 6) '(1 (2 (3 4) 5) 6)))
18 (test (tree-equal (cons 1 2) (cons 2 3)
19 :test (lambda (a b) (not (= a b)))))
22 (let ((nums '(1 2 3 4 5 6 7 8 9 10)))
23 (test (= (first nums) 1))
24 (test (= (second nums) 2))
25 (test (= (third nums) 3))
26 (test (= (fourth nums) 4))
27 (test (= (fifth nums) 5))
28 (test (= (sixth nums) 6))
29 (test (= (seventh nums) 7))
30 (test (= (eighth nums) 8))
31 (test (= (ninth nums) 9))
32 (test (= (tenth nums) 10)))
35 (let* ((a (list 1 2 3))
39 (test (tailp 'a (cons 'b 'a)))
42 ; FIXME: Write the alist in a more natural form once #72 has been fixed
43 (test (equal (cons (cons 1 2) (list (cons 3 4)))
44 (acons 1 2 (list (cons 3 4)))))
45 (test (equal (list (cons 1 2)) (acons 1 2 ())))
48 ; Can't really test this until EQUAL works properly on lists
51 (test (let* ((foo '(1 2 3))