X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fseq.pure.lisp;h=18ea6dcf1c14365b223b42ded7d87a9e989e3a93;hb=e0ba0f10da0a0f2722494bd2dd9646f0b5a44d75;hp=cb1cfe0b3ccae5536185d68f20a3a6b945288c71;hpb=84d5caf8c4c709bb39ba98b07b84cab90c234bfd;p=sbcl.git diff --git a/tests/seq.pure.lisp b/tests/seq.pure.lisp index cb1cfe0..18ea6dc 100644 --- a/tests/seq.pure.lisp +++ b/tests/seq.pure.lisp @@ -136,3 +136,28 @@ (return-from compare nil)) t)))))) '(0 0 0 0 0))) + +;;; miscellaneous sanity checks on stuff which could've been broken by +;;; changes in MERGE-LIST* in sbcl-0.7.11.* +(assert (equal (merge 'list () () '<) ())) +(assert (equal (merge 'list () (list 1) #'< :key 'identity) '(1))) +(assert (equal (merge 'list (list 2) () '>) '(2))) +(assert (equal (merge 'list (list 1 2 4) (list 2 3 7) '<) '(1 2 2 3 4 7))) +(assert (equal (merge 'list (list 1 2 4) (list -2 3 7) #'<) '(-2 1 2 3 4 7))) +(assert (equal (merge 'list (list 1 2 4) (vector -2 3 7) '< :key 'abs) + '(1 2 -2 3 4 7))) +(assert (equal (merge 'list (list 1 -2 4) (list -2 3 7) '< :key #'abs) + '(1 -2 -2 3 4 7))) +(assert (equal (stable-sort (list 1 10 2 12 13 3) '<) '(1 2 3 10 12 13))) +(assert (equal (stable-sort (list 1 10 2 12 13 3) #'< :key '-) + '(13 12 10 3 2 1))) +(assert (equal (stable-sort (list 1 10 2 12 13 3) '> :key #'-) + '(1 2 3 10 12 13))) +(assert (equal (stable-sort (list 1 2 3 -3 -2 -1) '< :key 'abs) + '(1 -1 2 -2 3 -3))) + +;;; CSR broke FILL by not returning the sequence argument in a transform. +(let* ((s1 (copy-seq "abcde")) + (s2 (fill s1 #\z))) + (assert s2) + (assert (string= s2 "zzzzz")))