194 |
(mismatch '(6 7 8 9) a :from-end t) |
(mismatch '(6 7 8 9) a :from-end t) |
195 |
(mismatch '(2 3 4 5) a :from-end t))) |
(mismatch '(2 3 4 5) a :from-end t))) |
196 |
nil nil 4 5 4 0) |
nil nil 4 5 4 0) |
197 |
|
|
198 |
|
(deftest mismatch-vector.24 |
199 |
|
(let ((m (make-array '(6) :initial-contents '(1 2 3 4 5 6) |
200 |
|
:fill-pointer 4)) |
201 |
|
(a '(1 2 3 4 5))) |
202 |
|
(list |
203 |
|
(mismatch m a) |
204 |
|
(mismatch m a :from-end t) |
205 |
|
(setf (fill-pointer m) 5) |
206 |
|
(mismatch m a) |
207 |
|
(mismatch m a :from-end t) |
208 |
|
(setf (fill-pointer m) 6) |
209 |
|
(mismatch m a) |
210 |
|
(mismatch m a :from-end t))) |
211 |
|
(4 4 5 nil nil 6 5 6)) |
212 |
|
|
213 |
;;; tests on bit vectors |
;;; tests on bit vectors |
214 |
|
|
364 |
(mismatch #*1111111 '(2 3 3) :from-end t :key 'evenp) |
(mismatch #*1111111 '(2 3 3) :from-end t :key 'evenp) |
365 |
5) |
5) |
366 |
|
|
367 |
|
(deftest mismatch-bit-vector.23 |
368 |
|
(let ((a (make-array '(9) :initial-contents (coerce #*001011000 'list) |
369 |
|
:fill-pointer 5 |
370 |
|
:element-type 'bit))) |
371 |
|
(values |
372 |
|
(mismatch #*00101 a) |
373 |
|
(mismatch #*00101 a :from-end t) |
374 |
|
(mismatch #*0010 a) |
375 |
|
(mismatch #*001011 a) |
376 |
|
(mismatch #*1000 a :from-end t) |
377 |
|
(mismatch #*0010 a :from-end t))) |
378 |
|
nil nil 4 5 4 4) |
379 |
|
|
380 |
|
(deftest mismatch-bit-vector.24 |
381 |
|
(let ((m (make-array '(6) :initial-contents (coerce #*001011 'list) |
382 |
|
:fill-pointer 4 |
383 |
|
:element-type 'bit)) |
384 |
|
(a #*00101)) |
385 |
|
(list |
386 |
|
(mismatch m a) |
387 |
|
(mismatch m a :from-end t) |
388 |
|
(setf (fill-pointer m) 5) |
389 |
|
(mismatch m a) |
390 |
|
(mismatch m a :from-end t) |
391 |
|
(setf (fill-pointer m) 6) |
392 |
|
(mismatch m a) |
393 |
|
(mismatch m a :from-end t))) |
394 |
|
(4 4 5 nil nil 6 5 5)) |
395 |
|
|
396 |
;;; tests on strings |
;;; tests on strings |
397 |
|
|
398 |
(deftest mismatch-string.1 |
(deftest mismatch-string.1 |
567 |
(deftest mismatch-string.22 |
(deftest mismatch-string.22 |
568 |
(mismatch "1111111" "233" :from-end t :key 'evendigitp) |
(mismatch "1111111" "233" :from-end t :key 'evendigitp) |
569 |
5) |
5) |
570 |
|
|
571 |
|
(deftest mismatch-string.23 |
572 |
|
(let ((a (make-array '(9) :initial-contents (coerce "123456789" 'list) |
573 |
|
:fill-pointer 5 |
574 |
|
:element-type 'character))) |
575 |
|
(values |
576 |
|
(mismatch "12345" a) |
577 |
|
(mismatch "12345" a :from-end t) |
578 |
|
(mismatch "1234" a) |
579 |
|
(mismatch "123456" a) |
580 |
|
(mismatch "6789" a :from-end t) |
581 |
|
(mismatch "2345" a :from-end t))) |
582 |
|
nil nil 4 5 4 0) |
583 |
|
|
584 |
|
(deftest mismatch-string.24 |
585 |
|
(let ((m (make-array '(6) :initial-contents (coerce "123456" 'list) |
586 |
|
:fill-pointer 4 |
587 |
|
:element-type 'character)) |
588 |
|
(a "12345")) |
589 |
|
(list |
590 |
|
(mismatch m a) |
591 |
|
(mismatch m a :from-end t) |
592 |
|
(setf (fill-pointer m) 5) |
593 |
|
(mismatch m a) |
594 |
|
(mismatch m a :from-end t) |
595 |
|
(setf (fill-pointer m) 6) |
596 |
|
(mismatch m a) |
597 |
|
(mismatch m a :from-end t))) |
598 |
|
(4 4 5 nil nil 6 5 6)) |