unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: 36568@debbugs.gnu.org
Subject: bug#36568: with-suppress-warnings not working in seq-tests.el
Date: Wed, 10 Jul 2019 05:23:07 +0200	[thread overview]
Message-ID: <CADwFkmnK7i5_cs_Rg=+TDYdZ2+W+w5dn2TaGbNMAGErwoe1ucA@mail.gmail.com> (raw)

[-- 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))

             reply	other threads:[~2019-07-10  3:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  3:23 Stefan Kangas [this message]
2019-07-10  3:42 ` bug#36568: with-suppress-warnings not working in seq-tests.el 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmnK7i5_cs_Rg=+TDYdZ2+W+w5dn2TaGbNMAGErwoe1ucA@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=36568@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).