X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fseq.pure.lisp;h=e59ab96968b1e92133b005707ea5a46cc8100fc7;hb=4c5a011ccc355e3653b9490de6a2b3df5777e55d;hp=18ea6dcf1c14365b223b42ded7d87a9e989e3a93;hpb=5c139b13882a2632a27a7f8fd81c8f1ab62b10a0;p=sbcl.git diff --git a/tests/seq.pure.lisp b/tests/seq.pure.lisp index 18ea6dc..e59ab96 100644 --- a/tests/seq.pure.lisp +++ b/tests/seq.pure.lisp @@ -64,6 +64,13 @@ (make-list (- 10 j) :initial-element 'a)))))))) +;;; And equally similarly, REMOVE-DUPLICATES misbehaved when given +;;; :START arguments: + +(let ((orig (list 0 1 2 0 1 2 0 1 2 0 1 2))) + (assert (equalp (remove-duplicates orig :start 3 :end 9) '(0 1 2 0 1 2 0 1 2))) + (assert (equalp (delete-duplicates orig :start 3 :end 9) '(0 1 2 0 1 2 0 1 2)))) + ;;; tests of COUNT (assert (= 1 (count 1 '(1 2 3)))) (assert (= 2 (count 'z #(z 1 2 3 z)))) @@ -161,3 +168,22 @@ (s2 (fill s1 #\z))) (assert s2) (assert (string= s2 "zzzzz"))) + +;;; POSITION on dispaced arrays with non-zero offset has been broken +;;; for quite a while... +(let ((fn (compile nil '(lambda (x) (position x))))) + (let* ((x #(1 2 3)) + (y (make-array 2 :displaced-to x :displaced-index-offset 1))) + (assert (= (position 2 y) 0)))) + +;;; (SIMPLE-STRING) is a legal type specifier for creation functions +(let ((a (make-sequence '(simple-string) 5)) + (b (concatenate '(simple-string) "a" "bdec")) + (c (map '(simple-string) 'identity "abcde")) + (d (merge '(simple-string) "acd" "be" 'char>)) + (e (coerce '(#\a #\b #\c #\e #\d) '(simple-string)))) + (assert (= (length a) 5)) + (assert (string= b "abdec")) + (assert (string= c "abcde")) + (assert (string= d "beacd")) + (assert (string= e "abced")))