From: Olof-Joachim Frahm Date: Mon, 10 Jun 2013 19:18:09 +0000 (+0200) Subject: Add SEARCH, MISMATCH testcases. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=dbd7f3f4c890a8f809a9ce35b58b1d662df6c2aa;p=jscl.git Add SEARCH, MISMATCH testcases. --- diff --git a/tests/seq.lisp b/tests/seq.lisp index a780b1b..6538f21 100644 --- a/tests/seq.lisp +++ b/tests/seq.lisp @@ -77,3 +77,18 @@ (test (equal (reduce #'+ '(100) :key #'1+) 101)) + +; MISMATCH +(test (= (mismatch '(1 2 3) '(1 2 3 4 5 6)) 3)) +(test (= (mismatch '(1 2 3) #(1 2 3 4 5 6)) 3)) +(test (= (mismatch #(1 2 3) '(1 2 3 4 5 6)) 3)) +(test (= (mismatch #(1 2 3) #(1 2 3 4 5 6)) 3)) + +; SEARCH +(test (= (search '(1 2 3) '(4 5 6 1 2 3)) 3)) +(test (= (search '(1 2 3) #(4 5 6 1 2 3)) 3)) +(test (= (search #(1 2 3) '(4 5 6 1 2 3)) 3)) +(test (= (search #(1 2 3) #(4 5 6 1 2 3)) 3)) +(test (not (search '(foo) '(1 2 3)))) +(test (= (search '(1) '(4 5 6 1 2 3)) 3)) +(test (= (search #(1) #(4 5 6 1 2 3)) 3))