243 |
result) |
result) |
244 |
#(a b z c b)) |
#(a b z c b)) |
245 |
|
|
246 |
|
(deftest nsubstitute-if-vector.32 |
247 |
|
(let* ((v1 (copy-seq #(a b c d a b c d a b c d a b c d))) |
248 |
|
(v2 (make-array '(8) :displaced-to v1 |
249 |
|
:displaced-index-offset 3))) |
250 |
|
(values |
251 |
|
(nsubstitute-if 'x (is-eql-p 'c) v2 :count 1) |
252 |
|
v1)) |
253 |
|
#(d a b x d a b c) |
254 |
|
#(a b c d a b x d a b c d a b c d)) |
255 |
|
|
256 |
|
(deftest nsubstitute-if-vector.33 |
257 |
|
(let* ((v1 (copy-seq #(a b c d a b c d a b c d a b c d))) |
258 |
|
(v2 (make-array '(8) :displaced-to v1 |
259 |
|
:displaced-index-offset 3))) |
260 |
|
(values |
261 |
|
(nsubstitute-if 'x (is-eql-p 'c) v2 :count 1 :from-end t) |
262 |
|
v1)) |
263 |
|
#(d a b c d a b x) |
264 |
|
#(a b c d a b c d a b x d a b c d)) |
265 |
|
|
266 |
;;; Tests on strings |
;;; Tests on strings |
267 |
|
|
268 |
(deftest nsubstitute-if-string.1 |
(deftest nsubstitute-if-string.1 |
399 |
result) |
result) |
400 |
"abzcb") |
"abzcb") |
401 |
|
|
402 |
|
(deftest nsubstitute-if-string.32 |
403 |
|
(do-special-strings |
404 |
|
(s "xyzabcxyzabc" nil) |
405 |
|
(assert (string= (nsubstitute-if #\! (is-eql-p #\a) s) "xyz!bcxyz!bc")) |
406 |
|
(assert (string= s "xyz!bcxyz!bc"))) |
407 |
|
nil) |
408 |
|
|
409 |
|
(deftest nsubstitute-if-string.33 |
410 |
|
(do-special-strings |
411 |
|
(s "xyzabcxyzabc" nil) |
412 |
|
(assert (string= (nsubstitute-if #\! (is-eql-p #\a) s :count 1) "xyz!bcxyzabc")) |
413 |
|
(assert (string= s "xyz!bcxyzabc"))) |
414 |
|
nil) |
415 |
|
|
416 |
|
(deftest nsubstitute-if-string.34 |
417 |
|
(do-special-strings |
418 |
|
(s "xyzabcxyzabc" nil) |
419 |
|
(assert (string= (nsubstitute-if #\! (is-eql-p #\a) s :count 1 :from-end t) "xyzabcxyz!bc")) |
420 |
|
(assert (string= s "xyzabcxyz!bc"))) |
421 |
|
nil) |
422 |
|
|
423 |
|
|
424 |
;;; Tests on bit-vectors |
;;; Tests on bit-vectors |
425 |
|
|