From ead28454b89c7ba532ecc3f0f4beac68e943b94d Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Sat, 18 Jun 2016 10:07:26 +0200 Subject: Fix seq-contains Make sure seq-contains return the element of the sequence instead of t. * lisp/emacs-lisp/seq.el (seq-contains): Fix the function. * test/lisp/emacs-lisp/seq-tests.el: Add a regression test. --- test/lisp/emacs-lisp/seq-tests.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/lisp/emacs-lisp') diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index b227de36e97..c2065c6718f 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -181,6 +181,10 @@ Evaluate BODY for each created sequence. (should-not (seq-contains seq 3)) (should-not (seq-contains seq nil)))) +(ert-deftest test-seq-contains-should-return-the-elt () + (with-test-sequences (seq '(3 4 5 6)) + (should (= 5 (seq-contains seq 5))))) + (ert-deftest test-seq-every-p () (with-test-sequences (seq '(43 54 22 1)) (should (seq-every-p (lambda (elt) t) seq)) -- cgit v1.2.3