/[gcl]/gcl/ansi-tests/notevery.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/notevery.lsp

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

revision 1.7 by pfdietz, Sat Jan 17 20:04:52 2004 UTC revision 1.8 by pfdietz, Sat Aug 28 20:52:38 2004 UTC
# Line 79  Line 79 
79    (notevery 'null '(nil nil nil nil))    (notevery 'null '(nil nil nil nil))
80    nil)    nil)
81    
82    ;;; Other specialized sequences
83    
84    (deftest notevery.17
85      (let ((v (make-array '(10) :initial-contents '(0 0 0 0 1 2 3 4 5 6)
86                           :fill-pointer 4)))
87        (loop for j from 0 to 9
88              do (setf (fill-pointer v) j)
89              collect (not (notevery #'zerop v))))
90      (t t t t t nil nil nil nil nil))
91    
92    (deftest notevery.18
93      (loop for i from 1 to 40
94            for type = `(unsigned-byte ,i)
95            unless
96            (let ((v (make-array '(10) :initial-contents '(0 0 0 0 1 1 1 1 1 1)
97                                 :element-type type
98                                 :fill-pointer 4)))
99              (equal (loop for j from 0 to 9
100                           do (setf (fill-pointer v) j)
101                           collect (not (notevery #'zerop v)))
102                     '(t t t t t nil nil nil nil nil)))
103            collect i)
104      nil)
105    
106    (deftest notevery.19
107      (loop for i from 1 to 40
108            for type = `(signed-byte ,i)
109            unless
110            (let ((v (make-array '(10) :initial-contents '(0 0 0 0 -1 -1 -1 -1 -1 -1)
111                                 :element-type type
112                                 :fill-pointer 4)))
113              (equal (loop for j from 0 to 9
114                           do (setf (fill-pointer v) j)
115                           collect (not (notevery #'zerop v)))
116                     '(t t t t t nil nil nil nil nil)))
117            collect i)
118      nil)
119    
120    (deftest notevery.20
121      (let ((v (make-array '(10) :initial-contents "abcd012345"
122                           :element-type 'character
123                           :fill-pointer 4)))
124        (loop for j from 0 to 9
125              do (setf (fill-pointer v) j)
126              collect (not (notevery #'alpha-char-p v))))
127      (t t t t t nil nil nil nil nil))
128    
129    (deftest notevery.21
130      (let ((v (make-array '(10) :initial-contents "abcd012345"
131                           :element-type 'base-char
132                           :fill-pointer 4)))
133        (loop for j from 0 to 9
134              do (setf (fill-pointer v) j)
135              collect (not (notevery #'alpha-char-p v))))
136      (t t t t t nil nil nil nil nil))
137    
138    (deftest notevery.22
139      (let ((v (make-array '(5) :initial-contents "abcde"
140                           :element-type 'base-char)))
141        (values
142         (not (notevery #'alpha-char-p v))
143         (setf (aref v 2) #\0)
144         (not (notevery #'alpha-char-p v))))
145      t #\0 nil)
146    
147    ;;; Displaced vectors
148    
149    (deftest notevery.23
150      (let* ((v1 (make-array '(10) :initial-contents '(1 3 2 4 6 8 5 7 9 1)))
151             (v2 (make-array '(4) :displaced-to v1
152                             :displaced-index-offset 2)))
153        (values
154         (not (notevery #'evenp v1))
155         (not (notevery 'evenp v2))))
156      nil t)
157    
158    (deftest notevery.24
159      (loop for i from 1 to 40
160            for type = `(unsigned-byte ,i)
161            unless
162            (let* ((v1 (make-array '(10) :initial-contents '(1 1 0 0 0 0 1 1 1 1)
163                                   :element-type type))
164                   (v2 (make-array '(4) :displaced-to v1
165                                   :displaced-index-offset 2
166                                   :element-type type)))
167              (and (notevery 'evenp v1)
168                   (not (notevery #'evenp v2))))
169            collect i)
170      nil)
171    
172    (deftest notevery.25
173      (loop for i from 1 to 40
174            for type = `(signed-byte ,i)
175            unless
176            (let* ((v1 (make-array '(10) :initial-contents '(-1 -1 0 0 0 0 -1 -1 -1 -1)
177                                   :element-type type))
178                   (v2 (make-array '(4) :displaced-to v1
179                                   :displaced-index-offset 2
180                                   :element-type type)))
181              (and (notevery 'evenp v1)
182                   (not (notevery #'evenp v2))))
183            collect i)
184      nil)
185    
186    (deftest notevery.26
187      (let* ((s1 (make-array '(8) :initial-contents "12abc345" :element-type 'character)))
188        (loop for i from 0 to 6
189              for s2 = (make-array '(2) :element-type 'character
190                                   :displaced-to s1
191                                   :displaced-index-offset i)
192              collect (not (notevery 'alpha-char-p s2))))
193      (nil nil t t nil nil nil))
194    
195    (deftest notevery.27
196      (let* ((s1 (make-array '(8) :initial-contents "12abc345" :element-type 'base-char)))
197        (loop for i from 0 to 6
198              for s2 = (make-array '(2) :element-type 'base-char
199                                   :displaced-to s1
200                                   :displaced-index-offset i)
201              collect (not (notevery 'alpha-char-p s2))))
202      (nil nil t t nil nil nil))
203    
204    ;;; adjustable vectors
205    
206    (deftest notevery.28
207      (let ((v (make-array '(10) :initial-contents '(1 2 3 4 5 6 7 8 9 10)
208                           :adjustable t)))
209        (values
210         (not (notevery #'plusp v))
211         (progn
212           (adjust-array v '(11) :initial-element -1)
213           (not (notevery #'plusp v)))))
214      t nil)
215    
216    (deftest notevery.29
217      (let ((v (make-array '(10) :initial-contents '(1 2 3 4 5 6 7 8 9 10)
218                           :fill-pointer 10
219                           :adjustable t)))
220        (values
221         (not (notevery #'plusp v))
222         (progn
223           (adjust-array v '(11) :initial-element -1)
224           (not (notevery #'plusp v)))))
225      t t)
226    
227    ;;; Float, complex vectors
228    
229    (deftest notevery.30
230      (loop for type in '(short-float single-float double-float long-float)
231            for v = (make-array '(6)
232                                :element-type type
233                                :initial-contents
234                                (mapcar #'(lambda (x) (coerce x type)) '(1 2 3 4 5 6)))
235            when (notevery #'plusp v)
236            collect (list type v))
237      nil)
238    
239    (deftest notevery.31
240      (loop for type in '(short-float single-float double-float long-float)
241            for v = (make-array '(6)
242                                :element-type type
243                                :fill-pointer 5
244                                :initial-contents
245                                (mapcar #'(lambda (x) (coerce x type)) '(1 2 3 4 5 -1)))
246            when (notevery #'plusp v)
247            collect (list type v))
248      nil)
249    
250    (deftest notevery.32
251      (loop for type in '(short-float single-float double-float long-float)
252            for ctype = `(complex ,type)
253            for v = (make-array '(6)
254                                :element-type ctype
255                                :initial-contents
256                                (mapcar #'(lambda (x) (complex x (coerce x type))) '(1 2 3 4 5 6)))
257            when (notevery #'complexp v)
258            collect (list type v))
259      nil)
260    
261    
262  (deftest notevery.order.1  (deftest notevery.order.1
263    (let ((i 0) a b)    (let ((i 0) a b)
264      (values      (values

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

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