X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Flist.pure.lisp;h=0abbdea906e0783d0acade57a53b77f850b80cd5;hb=f3b213e5fea9992b3a9a1f2a6c482239a1aff3c1;hp=e898b542a8bbb650abadef0f62594ce9a1c31af2;hpb=8a3bbf707f43fd95bc3025e3f222563c36b599fd;p=sbcl.git diff --git a/tests/list.pure.lisp b/tests/list.pure.lisp index e898b54..0abbdea 100644 --- a/tests/list.pure.lisp +++ b/tests/list.pure.lisp @@ -21,11 +21,6 @@ '((:args ((1 2 3 4 5)) :result (1 2 3 4)) (:args ((1 2 3 4 5) 6) :result nil) (:args (nil) :result nil) - (:args (t) :result nil) - (:args (foosymbol 0) :result foosymbol) - (:args (foosymbol) :result nil) - (:args (foosymbol 1) :result nil) - (:args (foosymbol 2) :result nil) (:args ((1 2 3) 0) :result (1 2 3)) (:args ((1 2 3) 1) :result (1 2)) (:args ((1 2 3)) :result (1 2)) @@ -51,3 +46,29 @@ (actual-result (apply #'nbutlast copied-list rest))) (unless (equal actual-result result) (error "failed NBUTLAST for ~S" args)))))) + +(multiple-value-bind (result error) + (ignore-errors (apply #'butlast (list t))) + (assert (null result)) + (assert (typep error 'type-error))) + +;;; reported by Paul Dietz on cmucl-imp: LDIFF does not check type of +;;; its first argument +(assert (not (ignore-errors (ldiff 1 2)))) + +;;; evaluation order in PUSH, PUSHNEW +(let ((a (map 'vector #'list '(a b c)))) + (let ((i 0)) + (pushnew (incf i) (aref a (incf i))) + (assert (equalp a #((a) (b) (1 c)))))) + +(symbol-macrolet ((s (aref a (incf i)))) + (let ((a (map 'vector #'list '(a b c)))) + (let ((i 0)) + (push t s) + (assert (equalp a #((a) (t b) (c)))) + (pushnew 1 s) + (assert (equalp a #((a) (t b) (1 c)))) + (setq i 0) + (assert (eql (pop s) 't)) + (assert (equalp a #((a) (b) (1 c)))))))