diff options
author | Po Lu <luangruo@yahoo.com> | 2021-12-05 08:36:40 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-12-05 08:36:40 +0800 |
commit | 360d2d3a3328799ed8fea27bc7c13873f84b65fa (patch) | |
tree | 579a7c080390d29b1aa6f772559c0f1946228779 /test/lisp/emacs-lisp/seq-tests.el | |
parent | f851e725b35d2ebd51b829059761a232d2ca1fbb (diff) | |
parent | b3505e31d6ce4ea7c2cf1b01b8b7357b1f527bf1 (diff) | |
download | emacs-360d2d3a3328799ed8fea27bc7c13873f84b65fa.tar.gz emacs-360d2d3a3328799ed8fea27bc7c13873f84b65fa.tar.bz2 emacs-360d2d3a3328799ed8fea27bc7c13873f84b65fa.zip |
Merge remote-tracking branch 'origin/master' into feature/pgtk
Diffstat (limited to 'test/lisp/emacs-lisp/seq-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/seq-tests.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index 8dc0b93b5af..8cfa3bdb862 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -172,17 +172,23 @@ Evaluate BODY for each created sequence. (should-not (seq-find #'null '(1 2 3))) (should (seq-find #'null '(1 2 3) 'sentinel))) +;; Hack to work around the ERT limitation that we can't reliably use +;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) +(defun seq--contains (&rest args) + (with-suppressed-warnings ((obsolete seq-contains)) + (apply #'seq-contains args))) + (ert-deftest test-seq-contains () (with-test-sequences (seq '(3 4 5 6)) - (should (seq-contains seq 3)) - (should-not (seq-contains seq 7))) + (should (seq--contains seq 3)) + (should-not (seq--contains seq 7))) (with-test-sequences (seq '()) - (should-not (seq-contains seq 3)) - (should-not (seq-contains seq nil)))) + (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))))) + (should (= 5 (seq--contains seq 5))))) (ert-deftest test-seq-contains-p () (with-test-sequences (seq '(3 4 5 6)) @@ -404,7 +410,7 @@ Evaluate BODY for each created sequence. (let ((seq '(1 (2 (3 (4)))))) (seq-let (_ (_ (_ (a)))) seq (should (= a 4)))) - (let (seq) + (let ((seq nil)) (seq-let (a b c) seq (should (null a)) (should (null b)) @@ -428,7 +434,7 @@ Evaluate BODY for each created sequence. (seq '(1 (2 (3 (4)))))) (seq-setq (_ (_ (_ (a)))) seq) (should (= a 4))) - (let (seq a b c) + (let ((seq nil) a b c) (seq-setq (a b c) seq) (should (null a)) (should (null b)) |