X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Flist.pure.lisp;h=caf0bb542f9ae5dab2f809a1ed18e20b2776a327;hb=ecd87c1ac0983a9ccf823c0344c5736c41e10e57;hp=00dc7939f51fb78cd29b118a0297736e77ec1bf7;hpb=b3a419f10ad442a1c59d51edabdc70518f193648;p=sbcl.git diff --git a/tests/list.pure.lisp b/tests/list.pure.lisp index 00dc793..caf0bb5 100644 --- a/tests/list.pure.lisp +++ b/tests/list.pure.lisp @@ -110,3 +110,22 @@ (copy-alist ((1 . 2) (3 . 4) . 5)))) (assert (raises-error? (apply (first test) (copy-tree (rest test))) type-error))) + +;;; Bug reported by Paul Dietz: NSET-EXCLUSIVE-OR should not return +;;; extra elements, even when given "sets" contain duplications +(assert (equal (remove-duplicates (sort (nset-exclusive-or (list 1 2 1 3) + (list 4 1 3 3)) + #'<)) + '(2 4))) + +;;; Bug reported by Adam Warner: valid list index designator is not +;;; necessary a fixnum +(let ((s (read-from-string "(a . #1=(b c . #1#))"))) + (assert (eq (nth (* 1440 most-positive-fixnum) s) 'c)) + (setf (nth (* 1440 most-positive-fixnum) s) 14) + (assert (eq (nth (* 1440 most-positive-fixnum) s) 14))) + +(let ((s (copy-list '(1 2 3)))) + (assert (eq s (last s (* 1440 most-positive-fixnum)))) + (assert (null (butlast s (* 1440 most-positive-fixnum)))) + (assert (null (nbutlast s (* 1440 most-positive-fixnum)))))