2
;;;; Author: Paul Dietz
3
;;;; Created: Sat Nov 2 21:38:08 2002
4
;;;; Contains: Tests for COPY-SEQ
8
;;; This function is extensively used elsewhere, but is tested again
9
;;; here for completeness.
17
(s2 (check-values (copy-seq s1))))
18
(and (not (eql s1 s2))
24
(s2 (check-values (copy-seq s1))))
25
(and (not (eql s1 s2)) s2))
29
(let* ((s1 (make-array '(4) :initial-contents '(a b c d)
31
(s2 (check-values (copy-seq s1))))
32
(and (not (eql s1 s2))
39
(let* ((s1 (make-array '(4) :initial-contents '(a b c d)
41
(s2 (check-values (copy-seq s1))))
42
(and (not (eql s1 s2))
48
(let* ((a1 (make-array '(6) :initial-contents '(a b c d e f)))
49
(a2 (make-array '(4) :displaced-to a1
50
:displaced-index-offset 1))
51
(s2 (check-values (copy-seq a2))))
52
(and (not (eql a2 s2))
58
(let* ((s1 (make-array '(4)
59
:element-type 'base-char
60
:initial-contents '(#\a #\b #\c #\d)
62
(s2 (check-values (copy-seq s1))))
63
(and (not (eql s1 s2))
70
(let* ((s1 (make-array '(4)
71
:element-type 'base-char
72
:initial-contents '(#\a #\b #\c #\d)
74
(s2 (check-values (copy-seq s1))))
75
(and (not (eql s1 s2))
81
(let* ((a1 (make-array '(6) :initial-contents '(#\a #\b #\c #\d #\e #\f)
82
:element-type 'base-char))
83
(a2 (make-array '(4) :displaced-to a1
84
:element-type 'base-char
85
:displaced-index-offset 1))
86
(s2 (check-values (copy-seq a2))))
87
(and (not (eql a2 s2))
94
(s2 (check-values (copy-seq s1))))
95
(and (not (eql s1 s2))
100
(let* ((s1 #*0010110)
101
(s2 (check-values (copy-seq s1))))
102
(and (not (eql s1 s2))
103
(simple-bit-vector-p s2)
108
(let* ((s1 (make-array '(4) :initial-contents '(0 0 1 0)
111
(s2 (check-values (copy-seq s1))))
112
(and (not (eql s1 s2))
113
(simple-bit-vector-p s2)
118
(let* ((s1 (make-array '(4) :initial-contents '(0 0 1 0)
121
(s2 (check-values (copy-seq s1))))
122
(and (not (eql s1 s2))
123
(simple-bit-vector-p s2)
128
(let* ((a1 (make-array '(6) :initial-contents '(0 0 1 0 1 1)
130
(a2 (make-array '(4) :displaced-to a1
131
:displaced-index-offset 1
133
(s2 (check-values (copy-seq a2))))
134
(and (not (eql a2 s2))
135
(simple-bit-vector-p s2)
152
(let* ((x (make-array '(10) :initial-contents '(a b c d e f g h i j)))
153
(y (check-values (copy-seq x))))
158
:notes (:nil-vectors-are-strings)
159
(copy-seq (make-array '(0) :element-type nil))
162
(deftest copy-seq.order.1
164
(values (copy-seq (progn (incf i) "abc")) i))
169
(deftest copy-seq.error.1
170
(signals-error (copy-seq 10) type-error)
173
(deftest copy-seq.error.2
174
(signals-error (copy-seq 'a) type-error)
177
(deftest copy-seq.error.3
178
(signals-error (copy-seq 13.21) type-error)
181
(deftest copy-seq.error.4
182
(signals-error (copy-seq) program-error)
185
(deftest copy-seq.error.5
186
(signals-error (copy-seq "abc" 2 nil) program-error)
189
(deftest copy-seq.error.6
190
(signals-error (locally (copy-seq 10) t) type-error)