source: trunk/source/tests/ansi-tests/list.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.6 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Apr 19 21:56:04 2003
4;;;; Contains: Tests of LIST, LIST*
5
6(in-package :cl-test)
7
8(compile-and-load "cons-aux.lsp")
9
10(deftest list.1
11  (list 'a 'b 'c)
12  (a b c))
13
14(deftest list.2
15  (list)
16  nil)
17
18(deftest list.order.1
19  (let ((i 0))
20    (list (incf i) (incf i) (incf i) (incf i)))
21  (1 2 3 4))
22
23(deftest list.order.2
24  (let ((i 0))
25    (list (incf i) (incf i) (incf i) (incf i)
26          (incf i) (incf i) (incf i) (incf i)))
27  (1 2 3 4 5 6 7 8))
28
29(deftest list.order.3
30  (let ((i 0))
31    (list (incf i) (incf i) (incf i) (incf i)
32          (incf i) (incf i) (incf i) (incf i)
33          (incf i) (incf i) (incf i) (incf i)
34          (incf i) (incf i) (incf i) (incf i)))
35  (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16))
36
37(def-fold-test list.fold.1 (list 'a))
38(def-fold-test list.fold.2 (list 'a 'b))
39(def-fold-test list.fold.3 (list 'a 'b 'c 'd 'e 'f))
40
41;;; LIST* tests
42
43(deftest list*.1
44  (list* 1 2 3)
45  (1 2 . 3))
46
47(deftest list*.2
48  (list* 'a)
49  a)
50
51(deftest list-list*.1
52  (list* 'a 'b 'c (list 'd 'e 'f))
53  (a b c d e f))
54
55(deftest list*.3
56  (list* 1)
57  1)
58
59(deftest list*.order.1
60  (let ((i 0))
61    (list* (incf i) (incf i) (incf i) (incf i)))
62  (1 2 3 . 4))
63
64(deftest list*.order.2
65  (let ((i 0))
66    (list* (incf i) (incf i) (incf i) (incf i)
67           (incf i) (incf i) (incf i) (incf i)
68           (incf i) (incf i) (incf i) (incf i)
69           (incf i) (incf i) (incf i) (incf i)))
70  (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . 16))
71
72(def-fold-test list*.fold.1 (list* 'a 'b))
73(def-fold-test list*.fold.2 (list* 'a 'b 'c))
74(def-fold-test list*.fold.3 (list* 'a 'b 'c 'd 'e 'f))
Note: See TracBrowser for help on using the repository browser.