0.9.1.59:
[sbcl.git] / tests / list.pure.lisp
index 9bf32a8..b1f588e 100644 (file)
                                                            (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)))))
+
+;;; Bug reported by Paul Dietz: ASSOC should ignore NIL elements in a
+;;; alist
+(let ((f (compile nil '(lambda (x)
+                        (assoc x '(nil (a . b) nil (nil . c) (c . d))
+                         :test #'eq)))))
+  (assert (equal (funcall f 'nil) '(nil . c))))