X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fseq.pure.lisp;h=3819f41acbec0f823af2716b17f17275ecc78bc1;hb=3f47602cbbfdb31c59252008b5f2dbe91ca43d7f;hp=2c1d638f7a1caf8f0b0bdb47cd2bc4b249db466c;hpb=dd92bd1d2fff942e6a38542364be21fa256cb4c0;p=sbcl.git diff --git a/tests/seq.pure.lisp b/tests/seq.pure.lisp index 2c1d638..3819f41 100644 --- a/tests/seq.pure.lisp +++ b/tests/seq.pure.lisp @@ -250,3 +250,44 @@ ;; 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)))) + +(with-test (:name (:search :empty-seq)) + (assert (eql 0 + (funcall (compile nil + `(lambda (x) + (declare (optimize (speed 3)) (simple-vector x)) + (search x #()))) + #()))) + (assert (eql 0 + (funcall (compile nil + `(lambda (x) + (declare (optimize (speed 3)) (simple-vector x)) + (search x #(t t t)))) + #()))) + (assert (eql 0 + (funcall (compile nil + `(lambda (x) + (declare (optimize (speed 3)) (simple-vector x)) + (search x #(t t t) :end1 0))) + #(t t t)))) + (assert (eql 0 + (funcall (compile nil + `(lambda (x) + (declare (optimize (speed 3)) (simple-vector x)) + (search x #(t t t) :key nil))) + #()))) + (assert (eql 0 + (funcall (compile nil + `(lambda (x k) + (declare (optimize (speed 3)) (simple-vector x)) + (search x #(t t t) :key k))) + #() nil))) + (assert (eq :ok + (handler-case + (funcall (compile nil + `(lambda (x) + (declare (optimize (speed 3)) (simple-vector x)) + (search x #(t t t) :start2 1 :end2 0 :end1 0))) + #(t t t)) + (sb-kernel:bounding-indices-bad-error () + :ok)))))