X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5a92d97802e095c541a644bdaca00755942af821..8aa0386420f9d982b99568f27a5953dfc737640e:/test/automated/seq-tests.el diff --git a/test/automated/seq-tests.el b/test/automated/seq-tests.el index 07a183d024..7023c94c0c 100644 --- a/test/automated/seq-tests.el +++ b/test/automated/seq-tests.el @@ -138,6 +138,16 @@ Evaluate BODY for each created sequence. (should-not (seq-some #'test-sequences-oddp seq))) (should (seq-some #'null '(1 nil 2)))) +(ert-deftest test-seq-find () + (with-test-sequences (seq '(4 3 2 1)) + (should (= 4 (seq-find #'test-sequences-evenp seq))) + (should (= 3 (seq-find #'test-sequences-oddp seq))) + (should-not (seq-find (lambda (elt) (> elt 10)) seq))) + (should-not (seq-find #'null '(1 nil 2))) + (should-not (seq-find #'null '(1 nil 2) t)) + (should-not (seq-find #'null '(1 2 3))) + (should (seq-find #'null '(1 2 3) 'sentinel))) + (ert-deftest test-seq-contains () (with-test-sequences (seq '(3 4 5 6)) (should (seq-contains seq 3))