/[gcl]/gcl/ansi-tests/cons-test-03.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/cons-test-03.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by pfdietz, Sat Feb 8 06:23:02 2003 UTC revision 1.9 by pfdietz, Mon Feb 17 04:22:03 2003 UTC
# Line 10  Line 10 
10  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11  ;;; copy-list  ;;; copy-list
12    
13  (deftest copy-list-1  (deftest copy-list.1
14      (check-copy-list '(a b c d))    (check-copy-list '(a b c d))
15    (a b c d))    (a b c d))
16    
17  ;; Check that copy-list works on dotted lists  ;; Check that copy-list works on dotted lists
18    
19  (deftest copy-list-2  (deftest copy-list.2
20      (check-copy-list '(a . b))    (check-copy-list '(a . b))
21   (a . b))   (a . b))
22    
23  (deftest copy-list-3  (deftest copy-list.3
24      (check-copy-list '(a b c . d))    (check-copy-list '(a b c . d))
25    (a b c . d))    (a b c . d))
26    
27    (deftest copy-list.4
28      (let ((i 0))
29        (values (copy-list (progn (incf i) '(a b c)))
30                i))
31      (a b c) 1)
32    
33  (deftest copy-list.error.1  (deftest copy-list.error.1
34    (classify-error (copy-list))    (classify-error (copy-list))
35    program-error)    program-error)
# Line 43  Line 49 
49    (list)    (list)
50    nil)    nil)
51    
52  (deftest list.3  (deftest list.order.1
53    (let ((i 0))    (let ((i 0))
54      (list (incf i) (incf i) (incf i) (incf i)))      (list (incf i) (incf i) (incf i) (incf i)))
55    (1 2 3 4))    (1 2 3 4))
56    
57  (deftest list.4  (deftest list.order.2
58    (let ((i 0))    (let ((i 0))
59      (list (incf i) (incf i) (incf i) (incf i)      (list (incf i) (incf i) (incf i) (incf i)
60            (incf i) (incf i) (incf i) (incf i)))            (incf i) (incf i) (incf i) (incf i)))
61    (1 2 3 4 5 6 7 8))    (1 2 3 4 5 6 7 8))
62    
63  (deftest list.5  (deftest list.order.3
64    (let ((i 0))    (let ((i 0))
65      (list (incf i) (incf i) (incf i) (incf i)      (list (incf i) (incf i) (incf i) (incf i)
66            (incf i) (incf i) (incf i) (incf i)            (incf i) (incf i) (incf i) (incf i)
# Line 74  Line 80 
80    (list* 'a 'b 'c (list 'd 'e 'f))    (list* 'a 'b 'c (list 'd 'e 'f))
81    (a b c d e f))    (a b c d e f))
82    
83  (deftest list*-3  (deftest list*.3
84    (list* 1)    (list* 1)
85    1)    1)
86    
87  (deftest list*.4  (deftest list*.order.1
88    (let ((i 0))    (let ((i 0))
89      (list* (incf i) (incf i) (incf i) (incf i)))      (list* (incf i) (incf i) (incf i) (incf i)))
90    (1 2 3 . 4))    (1 2 3 . 4))
91    
92  (deftest list*.5  (deftest list*.order.2
93    (let ((i 0))    (let ((i 0))
94      (list* (incf i) (incf i) (incf i) (incf i)      (list* (incf i) (incf i) (incf i) (incf i)
95             (incf i) (incf i) (incf i) (incf i)             (incf i) (incf i) (incf i) (incf i)
# Line 113  Line 119 
119          (list-length z))))          (list-length z))))
120    nil)    nil)
121    
122    (deftest list-length.order.1
123      (let ((i 0))
124        (values (list-length (progn (incf i) '(a b c))) i))
125      3 1)
126    
127    
128  ;; Check that list-length produces a type-error  ;; Check that list-length produces a type-error
129  ;; on arguments that are not proper lists or circular lists  ;; on arguments that are not proper lists or circular lists
# Line 174  Line 185 
185    (check-type-predicate 'listp 'list)    (check-type-predicate 'listp 'list)
186    0)    0)
187    
188    (deftest listp.order.1
189      (let ((i 0))
190        (values (listp (incf i)) i))
191      nil 1)
192    
193  (deftest listp.error.1  (deftest listp.error.1
194    (classify-error (listp))    (classify-error (listp))
195    program-error)    program-error)
# Line 213  Line 229 
229  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
230  ;;; make-list  ;;; make-list
231    
232  (deftest make-list-empty-1  (deftest make-list-empty.1
233    (make-list 0)    (make-list 0)
234    nil)    nil)
235    
236  (deftest make-list-empty-2  (deftest make-list-empty.2
237    (make-list 0 :initial-element 'a)    (make-list 0 :initial-element 'a)
238    nil)    nil)
239    
# Line 253  Line 269 
269    (make-list 5 :initial-element 'a :initial-element 'b)    (make-list 5 :initial-element 'a :initial-element 'b)
270    (a a a a a))    (a a a a a))
271    
272  (deftest make-list.order  (deftest make-list.order.1
273    (let ((i 0) x y)    (let ((i 0) x y)
274      (values      (values
275       (make-list (progn (setf x (incf i)) 5)       (make-list (progn (setf x (incf i)) 5)
# Line 263  Line 279 
279    (a a a a a)    (a a a a a)
280    2 1 2)    2 1 2)
281    
282    (deftest make-list.order.2
283      (let ((i 0) x y z)
284        (values
285         (make-list (progn (setf x (incf i)) 5)
286                    :initial-element
287                    (progn (setf y (incf i)) 'a)
288                    :initial-element
289                    (progn (setf z (incf i)) 'b))
290         i x y z))
291      (a a a a a)
292      3 1 2 3)
293    
294    
295  (deftest make-list.error.1  (deftest make-list.error.1
296    (catch-type-error (make-list -1))    (catch-type-error (make-list -1))
297    type-error)    type-error)

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26