207 |
(7 7) |
(7 7) |
208 |
(nil))) |
(nil))) |
209 |
|
|
210 |
|
(deftest position-if-vector.11 |
211 |
|
(let ((a (make-array '(10) :initial-contents '(1 3 1 4 3 1 2 1 8 9) |
212 |
|
:fill-pointer 5))) |
213 |
|
(flet ((%f (x) (eql x 1))) |
214 |
|
(values (position-if #'%f a) |
215 |
|
(position-if #'%f a :from-end t)))) |
216 |
|
0 2) |
217 |
|
|
218 |
;;; Bit vector tests |
;;; Bit vector tests |
219 |
|
|
220 |
(deftest position-if-bit-vector.1 |
(deftest position-if-bit-vector.1 |
317 |
(7 7) |
(7 7) |
318 |
(nil))) |
(nil))) |
319 |
|
|
320 |
|
(deftest position-if-bit-vector.13 |
321 |
|
(let ((a (make-array '(10) :initial-contents '(1 1 1 1 1 0 0 0 0 0) |
322 |
|
:fill-pointer 5 |
323 |
|
:element-type 'bit))) |
324 |
|
(values (position-if #'evenp a) |
325 |
|
(position-if #'evenp a :from-end 'foo) |
326 |
|
(position-if #'oddp a) |
327 |
|
(position-if #'oddp a :from-end 'foo))) |
328 |
|
nil nil 0 4) |
329 |
|
|
330 |
;;; string tests |
;;; string tests |
331 |
|
|
332 |
(deftest position-if-string.1 |
(deftest position-if-string.1 |
429 |
(7 7) |
(7 7) |
430 |
(nil))) |
(nil))) |
431 |
|
|
432 |
|
(deftest position-if-string.13 |
433 |
|
(flet ((%f (c) (eql c #\0)) |
434 |
|
(%g (c) (eql c #\1))) |
435 |
|
(let ((a (make-array '(10) :initial-contents |
436 |
|
(coerce "1111100000" 'list()) |
437 |
|
:fill-pointer 5 |
438 |
|
:element-type 'character))) |
439 |
|
(values (position-if #'%f a) |
440 |
|
(position-if #'%f a :from-end 'foo) |
441 |
|
(position-if #'%g a) |
442 |
|
(position-if #'%g a :from-end 'foo)))) |
443 |
|
nil nil 0 4) |
444 |
|
|
445 |
;;; Error tests |
;;; Error tests |
446 |
|
|
447 |
(deftest position-if-error.1 |
(deftest position-if-error.1 |