X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fseq.pure.lisp;h=1123ae2f7bd27b1eee0ccf0dd6c806a58d1b0d08;hb=1b650be8b800cf96e2c268ae317fb26d0bf36827;hp=cb1cfe0b3ccae5536185d68f20a3a6b945288c71;hpb=84d5caf8c4c709bb39ba98b07b84cab90c234bfd;p=sbcl.git diff --git a/tests/seq.pure.lisp b/tests/seq.pure.lisp index cb1cfe0..1123ae2 100644 --- a/tests/seq.pure.lisp +++ b/tests/seq.pure.lisp @@ -136,3 +136,23 @@ (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))) +