[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#36568: with-suppress-warnings not working in seq-tests.el
From: |
Lars Ingebrigtsen |
Subject: |
bug#36568: with-suppress-warnings not working in seq-tests.el |
Date: |
Wed, 07 Oct 2020 06:57:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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
- bug#36568: with-suppress-warnings not working in seq-tests.el,
Lars Ingebrigtsen <=