unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: 36568@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#36568: with-suppress-warnings not working in seq-tests.el
Date: Wed, 07 Oct 2020 06:57:03 +0200	[thread overview]
Message-ID: <87mu0y4ork.fsf@gnus.org> (raw)
In-Reply-To: <87v9halqdq.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 22 Aug 2020 16:14:09 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Odd.  To reproduce, I tried to just do:
>
> (require 'seq)
>
> (defun foo ()
>   (with-suppressed-warnings ((obsolete seq-contains))
>     (seq-contains '(3 4 5 6) 3)))
>
> But the warning is suppressed correctly then.  So there's ... something
> in the way the test files are compile that breaks
> with-suppressed-warnings?  Something in the ert macros?  Anybody got any
> ideas?

I poked around a bit more, and wondered whether the suppression would
survive if I pushed it as close to the function as possible:

(ert-deftest test-seq-contains-should-return-the-elt ()
  (should (= 5 (with-suppressed-warnings ((obsolete seq-contains))
                 (seq-contains '(1 2 3 4 5) 5)))))

But this leads to:

Debugger entered--Lisp error: (void-function internal--with-suppressed-warnings)
  signal(void-function (internal--with-suppressed-warnings))
  apply(signal (void-function (internal--with-suppressed-warnings)))
  (setq value-2846 (apply fn-2844 args-2845))
  (unwind-protect (setq value-2846 (apply fn-2844 args-2845)) (setq form-description-2848 (nconc (list '(should (= 5 (with-suppressed-warnings ... ...)))) (list :form (cons fn-2844 args-2845)) (if (eql value-2846 'ert-form-evaluation-aborted-2847) nil (list :value value-2846)) (let ((-explainer- (and (symbolp ...) (get ... ...)))) (if -explainer- (progn (list :explanation (apply -explainer- args-2845))))))) (ert--signal-should-execution form-description-2848))
  (if (unwind-protect (setq value-2846 (apply fn-2844 args-2845)) (setq form-description-2848 (nconc (list '(should (= 5 ...))) (list :form (cons fn-2844 args-2845)) (if (eql value-2846 'ert-form-evaluation-aborted-2847) nil (list :value value-2846)) (let ((-explainer- (and ... ...))) (if -explainer- (progn (list :explanation ...)))))) (ert--signal-should-execution form-description-2848)) nil (ert-fail form-description-2848))
  (let (form-description-2848) (if (unwind-protect (setq value-2846 (apply fn-2844 args-2845)) (setq form-description-2848 (nconc (list '(should ...)) (list :form (cons fn-2844 args-2845)) (if (eql value-2846 'ert-form-evaluation-aborted-2847) nil (list :value value-2846)) (let ((-explainer- ...)) (if -explainer- (progn ...))))) (ert--signal-should-execution form-description-2848)) nil (ert-fail form-description-2848)))
  (let ((value-2846 'ert-form-evaluation-aborted-2847)) (let (form-description-2848) (if (unwind-protect (setq value-2846 (apply fn-2844 args-2845)) (setq form-description-2848 (nconc (list '...) (list :form (cons fn-2844 args-2845)) (if (eql value-2846 ...) nil (list :value value-2846)) (let (...) (if -explainer- ...)))) (ert--signal-should-execution form-description-2848)) nil (ert-fail form-description-2848))) value-2846)
  (let* ((fn-2844 #'=) (args-2845 (condition-case err (let ((signal-hook-function #'ert--should-signal-hook)) (list 5 (internal--with-suppressed-warnings '... (progn ...)))) (error (progn (setq fn-2844 #'signal) (list (car err) (cdr err))))))) (let ((value-2846 'ert-form-evaluation-aborted-2847)) (let (form-description-2848) (if (unwind-protect (setq value-2846 (apply fn-2844 args-2845)) (setq form-description-2848 (nconc (list ...) (list :form ...) (if ... nil ...) (let ... ...))) (ert--signal-should-execution form-description-2848)) nil (ert-fail form-description-2848))) value-2846))
  (progn (let* ((fn-2844 #'=) (args-2845 (condition-case err (let ((signal-hook-function ...)) (list 5 (internal--with-suppressed-warnings ... ...))) (error (progn (setq fn-2844 ...) (list ... ...)))))) (let ((value-2846 'ert-form-evaluation-aborted-2847)) (let (form-description-2848) (if (unwind-protect (setq value-2846 (apply fn-2844 args-2845)) (setq form-description-2848 (nconc ... ... ... ...)) (ert--signal-should-execution form-description-2848)) nil (ert-fail form-description-2848))) value-2846)))
  eval((progn (let* ((fn-2844 #'=) (args-2845 (condition-case err (let (...) (list 5 ...)) (error (progn ... ...))))) (let ((value-2846 'ert-form-evaluation-aborted-2847)) (let (form-description-2848) (if (unwind-protect (setq value-2846 ...) (setq form-description-2848 ...) (ert--signal-should-execution form-description-2848)) nil (ert-fail form-description-2848))) value-2846))) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-10-07  4:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=87mu0y4ork.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=36568@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    /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).