diff options
| author | Nicolas Petton | 2016-06-18 10:07:26 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2016-06-18 10:10:00 +0200 |
| commit | ead28454b89c7ba532ecc3f0f4beac68e943b94d (patch) | |
| tree | 20beb5f44fb75e809a0b4d838895787a7435d582 /test | |
| parent | 2aebb0dd1fc66ba8cacef3f734e9a046cbc04ad2 (diff) | |
| download | emacs-ead28454b89c7ba532ecc3f0f4beac68e943b94d.tar.gz emacs-ead28454b89c7ba532ecc3f0f4beac68e943b94d.zip | |
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.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/seq-tests.el | 4 |
1 files changed, 4 insertions, 0 deletions
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. | |||
| 181 | (should-not (seq-contains seq 3)) | 181 | (should-not (seq-contains seq 3)) |
| 182 | (should-not (seq-contains seq nil)))) | 182 | (should-not (seq-contains seq nil)))) |
| 183 | 183 | ||
| 184 | (ert-deftest test-seq-contains-should-return-the-elt () | ||
| 185 | (with-test-sequences (seq '(3 4 5 6)) | ||
| 186 | (should (= 5 (seq-contains seq 5))))) | ||
| 187 | |||
| 184 | (ert-deftest test-seq-every-p () | 188 | (ert-deftest test-seq-every-p () |
| 185 | (with-test-sequences (seq '(43 54 22 1)) | 189 | (with-test-sequences (seq '(43 54 22 1)) |
| 186 | (should (seq-every-p (lambda (elt) t) seq)) | 190 | (should (seq-every-p (lambda (elt) t) seq)) |