[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 9037159c47a: Pacify byte-compiler warnings in nadvice-tests
From: |
Basil L. Contovounesios |
Subject: |
master 9037159c47a: Pacify byte-compiler warnings in nadvice-tests |
Date: |
Sun, 9 Apr 2023 14:05:12 -0400 (EDT) |
branch: master
commit 9037159c47a1ab53f860de91cf4f97ff56acd96f
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Pacify byte-compiler warnings in nadvice-tests
* test/lisp/emacs-lisp/nadvice-tests.el
(advice-test-called-interactively-p)
(advice-test-called-interactively-p-around)
(advice-test-called-interactively-p-filter-args)
(advice-test-call-interactively): Heed advertised-calling-convention
of called-interactively-p to pacify byte-compiler warnings.
---
test/lisp/emacs-lisp/nadvice-tests.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/test/lisp/emacs-lisp/nadvice-tests.el
b/test/lisp/emacs-lisp/nadvice-tests.el
index 716ab694e2c..f6bd5733ba3 100644
--- a/test/lisp/emacs-lisp/nadvice-tests.el
+++ b/test/lisp/emacs-lisp/nadvice-tests.el
@@ -118,20 +118,20 @@
(declare-function sm-test7 nil)
(advice-add 'sm-test7 :around
(lambda (f &rest args)
- (list (cons 1 (called-interactively-p)) (apply f args))))
+ (list (cons 1 (called-interactively-p 'any)) (apply f args))))
(should (equal (sm-test7) '((1 . nil) 11)))
(should (equal (call-interactively 'sm-test7) '((1 . t) 11)))
(let ((smi 7))
(advice-add 'sm-test7 :before
(lambda (&rest _args)
- (setq smi (called-interactively-p))))
+ (setq smi (called-interactively-p 'any))))
(should (equal (list (sm-test7) smi)
'(((1 . nil) 11) nil)))
(should (equal (list (call-interactively 'sm-test7) smi)
'(((1 . t) 11) t))))
(advice-add 'sm-test7 :around
(lambda (f &rest args)
- (cons (cons 2 (called-interactively-p)) (apply f args))))
+ (cons (cons 2 (called-interactively-p 'any)) (apply f args))))
(should (equal (call-interactively 'sm-test7) '((2 . t) (1 . t) 11))))
(ert-deftest advice-test-called-interactively-p-around ()
@@ -140,18 +140,18 @@
This tests the currently broken case of the innermost advice to a
function being an around advice."
:expected-result :failed
- (defun sm-test7.2 () (interactive) (cons 1 (called-interactively-p)))
+ (defun sm-test7.2 () (interactive) (cons 1 (called-interactively-p 'any)))
(declare-function sm-test7.2 nil)
(advice-add 'sm-test7.2 :around
(lambda (f &rest args)
- (list (cons 1 (called-interactively-p)) (apply f args))))
+ (list (cons 1 (called-interactively-p 'any)) (apply f args))))
(should (equal (sm-test7.2) '((1 . nil) (1 . nil))))
(should (equal (call-interactively 'sm-test7.2) '((1 . t) (1 . t)))))
(ert-deftest advice-test-called-interactively-p-filter-args ()
"Check interaction between filter-args advice and called-interactively-p."
:expected-result :failed
- (defun sm-test7.3 () (interactive) (cons 1 (called-interactively-p)))
+ (defun sm-test7.3 () (interactive) (cons 1 (called-interactively-p 'any)))
(declare-function sm-test7.3 nil)
(advice-add 'sm-test7.3 :filter-args #'list)
(should (equal (sm-test7.3) '(1 . nil)))
@@ -159,7 +159,9 @@ function being an around advice."
(ert-deftest advice-test-call-interactively ()
"Check interaction between advice on call-interactively and
called-interactively-p."
- (let ((sm-test7.4 (lambda () (interactive) (cons 1
(called-interactively-p))))
+ (let ((sm-test7.4 (lambda ()
+ (interactive)
+ (cons 1 (called-interactively-p 'any))))
(old (symbol-function 'call-interactively)))
(unwind-protect
(progn
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 9037159c47a: Pacify byte-compiler warnings in nadvice-tests,
Basil L. Contovounesios <=