X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fseq.lisp;h=ce1c8d66d39fa955247a01fc6eb4be20b4588566;hb=ac02066a55d3a19c41a70ad5b71d02c49a28e282;hp=c39b0ce174b26e5ed5de32ab90703fb637ac748e;hpb=3d1e86f1638c71cfc4d11638dcb6b42cfd30d859;p=jscl.git diff --git a/tests/seq.lisp b/tests/seq.lisp index c39b0ce..ce1c8d6 100644 --- a/tests/seq.lisp +++ b/tests/seq.lisp @@ -37,6 +37,10 @@ (test (= (position 1 #(1 1 3) :test-not #'=) 2)) (test (= (position 1 '(1 1 3) :test-not #'=) 2)) +;; POSITION-IF, POSITION-IF-NOT +(test (= 2 (position-if #'oddp '((1) (2) (3) (4)) :start 1 :key #'car))) +(test (= 4 (position-if-not #'integerp '(1 2 3 4 X)))) ;; (hyperspec example used "5.0", but we don't have a full numeric tower yet!) + ; REMOVE-IF (test (equal (remove-if #'zerop '(1 0 2 0 3)) '(1 2 3))) (test (equal (remove-if-not #'zerop '(1 0 2 0 3)) '(0 0)))