From: Stefan Kangas Date: Sun, 5 Dec 2021 11:08:27 +0000 (+0100) Subject: Remove hacks for broken `with-suppressed-warnings' X-Git-Tag: emacs-29.0.90~3617^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9167fbd323c5f8ca1262372be0e213f284cadc67;p=emacs.git Remove hacks for broken `with-suppressed-warnings' * test/lisp/obsolete/cl-tests.el (labels-function-quoting): * test/lisp/tar-mode-tests.el (tar-mode-test-tar-grind-file-mode): Remove hack for broken `with-suppressed-warnings'. --- diff --git a/test/lisp/obsolete/cl-tests.el b/test/lisp/obsolete/cl-tests.el index 0b8c1178f3a..659c51ebcf8 100644 --- a/test/lisp/obsolete/cl-tests.el +++ b/test/lisp/obsolete/cl-tests.el @@ -25,17 +25,11 @@ (require 'cl)) (require 'ert) - - -;; Hack to work around the ERT limitation that we can't reliably use -;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) -(defun cl-tests-labels-test () - (with-suppressed-warnings ((obsolete labels)) - (funcall (labels ((foo () t)) - #'foo)))) - (ert-deftest labels-function-quoting () "Test that #'foo does the right thing in `labels'." ; Bug#31792. - (should (eq (cl-tests-labels-test) t))) + (with-suppressed-warnings ((obsolete labels)) + (should (eq (funcall (labels ((foo () t)) + #'foo)) + t)))) ;;; cl-tests.el ends here diff --git a/test/lisp/tar-mode-tests.el b/test/lisp/tar-mode-tests.el index dd430cac2fd..2e0d1529a57 100644 --- a/test/lisp/tar-mode-tests.el +++ b/test/lisp/tar-mode-tests.el @@ -24,12 +24,6 @@ (defvar tar-mode-tests-data-directory (expand-file-name "test/data/decompress" source-directory)) -;; Hack to work around the ERT limitation that we can't reliably use -;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568) -(defun tar-mode-tests--tar-grind-file-mode (&rest args) - (with-suppressed-warnings ((obsolete tar-grind-file-mode)) - (apply #'tar-grind-file-mode args))) - (ert-deftest tar-mode-test-tar-grind-file-mode () (let ((alist (list (cons 448 "rwx------") (cons 420 "rw-r--r--") @@ -38,7 +32,8 @@ (cons 1024 "-----S---") (cons 2048 "--S------")))) (dolist (x alist) - (should (equal (cdr x) (tar-mode-tests--tar-grind-file-mode (car x))))))) + (with-suppressed-warnings ((obsolete tar-grind-file-mode)) + (should (equal (cdr x) (tar-grind-file-mode (car x)))))))) (ert-deftest tar-mode-test-tar-extract-gz () (skip-unless (executable-find "gzip"))