X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fseq.pure.lisp;h=2c1d638f7a1caf8f0b0bdb47cd2bc4b249db466c;hb=7976926f8112b708d5927a69923cf7a3dd003c55;hp=eb75013e8f1b15693071062ec3616cb0ee493400;hpb=1ab1dd29f2602c87d404492e588abdf5f6abfbf2;p=sbcl.git diff --git a/tests/seq.pure.lisp b/tests/seq.pure.lisp index eb75013..2c1d638 100644 --- a/tests/seq.pure.lisp +++ b/tests/seq.pure.lisp @@ -224,16 +224,16 @@ (second got) ',lambda))))) (test sb-kernel:bounding-indices-bad-error (lambda () - (find :foo '(1 2 3 :foo) :start 1 :end 5))) + (find :foo '(1 2 3 :foo) :start 1 :end 5 :from-end t))) (test sb-kernel:bounding-indices-bad-error (lambda () - (position :foo '(1 2 3 :foo) :start 1 :end 5))) + (position :foo '(1 2 3 :foo) :start 1 :end 5 :from-end t))) (test sb-kernel:bounding-indices-bad-error (lambda () - (find :foo '(1 2 3 :foo) :start 3 :end 0))) + (find :foo '(1 2 3 :foo) :start 3 :end 0 :from-end t))) (test sb-kernel:bounding-indices-bad-error (lambda () - (position :foo '(1 2 3 :foo) :start 3 :end 0))) + (position :foo '(1 2 3 :foo) :start 3 :end 0 :from-end t))) (test type-error (lambda () (let ((list (list 1 2 3 :foo))) @@ -242,3 +242,11 @@ (lambda () (let ((list (list 1 2 3 :foo))) (position :bar (nconc list list))))))) + +(with-test (:name :bug-554385) + ;; FIND-IF shouldn't look through the entire list. + (assert (= 2 (find-if #'evenp '(1 2 1 1 1 1 1 1 1 1 1 1 :foo)))) + ;; Even though the end bounds are incorrect, the + ;; element is found before that's an issue. + (assert (eq :foo (find :foo '(1 2 3 :foo) :start 1 :end 5))) + (assert (= 3 (position :foo '(1 2 3 :foo) :start 1 :end 5))))