]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove hack from seq-tests.el for broken `with-suppressed-warnings'
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 5 Dec 2021 03:20:55 +0000 (04:20 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 5 Dec 2021 03:20:55 +0000 (04:20 +0100)
* test/lisp/emacs-lisp/seq-tests.el: `with-suppressed-warnings'
now works better in erf-deftests, so remove hack that works around
it (bug#36568).

test/lisp/emacs-lisp/seq-tests.el

index 8cfa3bdb86280eb364f6e826c577ed02e5f8fce1..4b940af81f1f38e6bbf7db2cacd8fcde734426c9 100644 (file)
@@ -172,23 +172,19 @@ 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)))
-  (with-test-sequences (seq '())
-    (should-not (seq--contains seq 3))
-    (should-not (seq--contains seq nil))))
+  (with-suppressed-warnings ((obsolete seq-contains))
+    (with-test-sequences (seq '(3 4 5 6))
+      (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)))))
 
 (ert-deftest test-seq-contains-should-return-the-elt ()
-  (with-test-sequences (seq '(3 4 5 6))
-    (should (= 5 (seq--contains seq 5)))))
+  (with-suppressed-warnings ((obsolete seq-contains))
+    (with-test-sequences (seq '(3 4 5 6))
+      (should (= 5 (seq-contains seq 5))))))
 
 (ert-deftest test-seq-contains-p ()
   (with-test-sequences (seq '(3 4 5 6))