unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36568: with-suppress-warnings not working in seq-tests.el
@ 2019-07-10  3:23 Stefan Kangas
  2019-07-10  3:42 ` Stefan Kangas
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Kangas @ 2019-07-10  3:23 UTC (permalink / raw)
  To: 36568

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

On current master, I'm seeing strange behaviour when trying to
suppress warnings in the test suite using with-suppressed-warnings.

(See also related bug Bug#36567 -- not sure if it's a duplicate.
Please merge if it is.)

Steps to reproduce:
0. Apply attached patch bug-suppressed-warnings.diff
1. Open shell
2. cd emacs/test
3. rm lisp/emacs-lisp/seq-tests.elc
4. make lisp/emacs-lisp/seq-tests

Result:
  ELC      lisp/emacs-lisp/seq-tests.elc

In toplevel form:
lisp/emacs-lisp/seq-tests.el:183:20:Warning: `seq-contains' is an obsolete
    function (as of 27.1); use `seq-contains-p' instead.
lisp/emacs-lisp/seq-tests.el:183:20:Warning: `seq-contains' is an obsolete
    function (as of 27.1); use `seq-contains-p' instead.
lisp/emacs-lisp/seq-tests.el:183:20:Warning: `seq-contains' is an obsolete
    function (as of 27.1); use `seq-contains-p' instead.
[...]

Expected result:
No such warnings appear.


In GNU Emacs 27.0.50 (build 2, x86_64-apple-darwin15.6.0, NS
appkit-1404.47 Version 10.11.6 (Build 15G22010))
 of 2019-07-10 built on Stefans-MBP
Repository revision: 77cf71ce8cc611ecfd143277441e2ad4acc9401b
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1404
System Description:  Mac OS X 10.11.6

[-- Attachment #2: bug-suppressed-warnings.diff --]
[-- Type: application/octet-stream, Size: 1221 bytes --]

diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
index ef05e2b389..35fa2b1916 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -174,16 +174,18 @@ test-seq-find
   (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))
-    (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))

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-05 11:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10  3:23 bug#36568: with-suppress-warnings not working in seq-tests.el Stefan Kangas
2019-07-10  3:42 ` Stefan Kangas
2020-08-22 14:14 ` Lars Ingebrigtsen
2020-10-07  4:57   ` Lars Ingebrigtsen
2020-10-07  5:18     ` Lars Ingebrigtsen
2020-10-07  5:35       ` Michael Heerdegen
2021-12-05  3:22 ` Lars Ingebrigtsen
2021-12-05 11:27   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).