805 |
result) |
result) |
806 |
#((a 1) (a 10) (a 3) (a 10) (a 10) (a 6) (a 10))) |
#((a 1) (a 10) (a 3) (a 10) (a 10) (a 6) (a 10))) |
807 |
|
|
808 |
|
(deftest nsubstitute-vector.32 |
809 |
|
(let* ((v1 (copy-seq #(a b c d a b c d a b c d a b c d))) |
810 |
|
(v2 (make-array '(8) :displaced-to v1 |
811 |
|
:displaced-index-offset 3))) |
812 |
|
(values |
813 |
|
(nsubstitute 'x 'c v2 :count 1) |
814 |
|
v1)) |
815 |
|
#(d a b x d a b c) |
816 |
|
#(a b c d a b x d a b c d a b c d)) |
817 |
|
|
818 |
|
(deftest nsubstitute-vector.33 |
819 |
|
(let* ((v1 (copy-seq #(a b c d a b c d a b c d a b c d))) |
820 |
|
(v2 (make-array '(8) :displaced-to v1 |
821 |
|
:displaced-index-offset 3))) |
822 |
|
(values |
823 |
|
(nsubstitute 'x 'c v2 :count 1 :from-end t) |
824 |
|
v1)) |
825 |
|
#(d a b c d a b x) |
826 |
|
#(a b c d a b c d a b x d a b c d)) |
827 |
|
|
828 |
|
|
829 |
(deftest nsubstitute-string.24 |
(deftest nsubstitute-string.24 |
830 |
(let* ((orig "0102342015") |
(let* ((orig "0102342015") |
831 |
(x (copy-seq orig)) |
(x (copy-seq orig)) |
854 |
result) |
result) |
855 |
"0a0aaaa0aa") |
"0a0aaaa0aa") |
856 |
|
|
857 |
|
(deftest nsubstitute-string.32 |
858 |
|
(do-special-strings |
859 |
|
(s "xyzabcxyzabc" nil) |
860 |
|
(assert (string= (nsubstitute #\! #\a s) "xyz!bcxyz!bc")) |
861 |
|
(assert (string= s "xyz!bcxyz!bc"))) |
862 |
|
nil) |
863 |
|
|
864 |
|
(deftest nsubstitute-string.33 |
865 |
|
(do-special-strings |
866 |
|
(s "xyzabcxyzabc" nil) |
867 |
|
(assert (string= (nsubstitute #\! #\a s :count 1) "xyz!bcxyzabc")) |
868 |
|
(assert (string= s "xyz!bcxyzabc"))) |
869 |
|
nil) |
870 |
|
|
871 |
|
(deftest nsubstitute-string.34 |
872 |
|
(do-special-strings |
873 |
|
(s "xyzabcxyzabc" nil) |
874 |
|
(assert (string= (nsubstitute #\! #\a s :count 1 :from-end t) "xyzabcxyz!bc")) |
875 |
|
(assert (string= s "xyzabcxyz!bc"))) |
876 |
|
nil) |
877 |
|
|
878 |
|
;;; More bit vector tests |
879 |
|
|
880 |
(deftest nsubstitute-bit-vector.30 |
(deftest nsubstitute-bit-vector.30 |
881 |
(let* ((x (make-array '(10) :initial-contents '(0 1 0 1 1 0 1 1 0 1) |
(let* ((x (make-array '(10) :initial-contents '(0 1 0 1 1 0 1 1 0 1) |
882 |
:fill-pointer 5 :element-type 'bit)) |
:fill-pointer 5 :element-type 'bit)) |