aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2024-12-14 09:37:17 +0100
committerMichael Albinus2024-12-14 09:37:17 +0100
commit83245d2269be357db2fff8baa17adb4b05f97aed (patch)
tree2afb43776ceb43350f032258370e0f2b08c26fea /test
parent2719dccbe5797dd8fcf1ce013df2ff71161b6f55 (diff)
downloademacs-83245d2269be357db2fff8baa17adb4b05f97aed.tar.gz
emacs-83245d2269be357db2fff8baa17adb4b05f97aed.zip
Fix xt-mouse-tests.el in interactive mode
* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Run only when noninteractive.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/xt-mouse-tests.el53
1 files changed, 27 insertions, 26 deletions
diff --git a/test/lisp/xt-mouse-tests.el b/test/lisp/xt-mouse-tests.el
index f64b3aed73e..0610b6f94c5 100644
--- a/test/lisp/xt-mouse-tests.el
+++ b/test/lisp/xt-mouse-tests.el
@@ -30,32 +30,33 @@
30(defmacro with-xterm-mouse-mode (&rest body) 30(defmacro with-xterm-mouse-mode (&rest body)
31 "Run BODY with `xterm-mouse-mode' temporarily enabled." 31 "Run BODY with `xterm-mouse-mode' temporarily enabled."
32 (declare (indent 0)) 32 (declare (indent 0))
33 `(let ((width (frame-width)) 33 (when noninteractive
34 (height (frame-height))) 34 `(let ((width (frame-width))
35 (unwind-protect 35 (height (frame-height)))
36 (progn 36 (unwind-protect
37 ;; Make the frame huge so that the test input events below 37 (progn
38 ;; don't hit the menu bar. 38 ;; Make the frame huge so that the test input events below
39 (set-frame-width nil (max width 2000)) 39 ;; don't hit the menu bar.
40 (set-frame-height nil (max height 2000)) 40 (set-frame-width nil (max width 2000))
41 (cl-letf (;; Reset XTerm parameters so that the tests don't 41 (set-frame-height nil (max height 2000))
42 ;; get confused. 42 (cl-letf (;; Reset XTerm parameters so that the tests don't
43 ((terminal-parameter nil 'xterm-mouse-x) nil) 43 ;; get confused.
44 ((terminal-parameter nil 'xterm-mouse-y) nil) 44 ((terminal-parameter nil 'xterm-mouse-x) nil)
45 ((terminal-parameter nil 'xterm-mouse-last-down) nil) 45 ((terminal-parameter nil 'xterm-mouse-y) nil)
46 ((terminal-parameter nil 'xterm-mouse-last-click) nil)) 46 ((terminal-parameter nil 'xterm-mouse-last-down) nil)
47 (unwind-protect 47 ((terminal-parameter nil 'xterm-mouse-last-click) nil))
48 (progn 48 (unwind-protect
49 ;; `xterm-mouse-mode' doesn't work in the initial 49 (progn
50 ;; terminal. Since we can't create a second 50 ;; `xterm-mouse-mode' doesn't work in the initial
51 ;; terminal in batch mode, fake it temporarily. 51 ;; terminal. Since we can't create a second
52 (cl-letf (((symbol-function 'terminal-name) 52 ;; terminal in batch mode, fake it temporarily.
53 (lambda (&optional _terminal) "fake-terminal"))) 53 (cl-letf (((symbol-function 'terminal-name)
54 (xterm-mouse-mode 1)) 54 (lambda (&optional _terminal) "fake-terminal")))
55 ,@body) 55 (xterm-mouse-mode 1))
56 (xterm-mouse-mode 0)))) 56 ,@body)
57 (set-frame-width nil width) 57 (xterm-mouse-mode 0))))
58 (set-frame-height nil height)))) 58 (set-frame-width nil width)
59 (set-frame-height nil height)))))
59 60
60(ert-deftest xt-mouse-tracking-basic () 61(ert-deftest xt-mouse-tracking-basic ()
61 (should (equal (xterm-mouse-tracking-enable-sequence) 62 (should (equal (xterm-mouse-tracking-enable-sequence)