emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3e5259a: Use mouse-wheel-up-event in mwheel-tests.el


From: Stefan Kangas
Subject: master 3e5259a: Use mouse-wheel-up-event in mwheel-tests.el
Date: Tue, 8 Sep 2020 12:32:19 -0400 (EDT)

branch: master
commit 3e5259a268d423ef3b6a0ffcfe05ac623bbe7f25
Author: Daniel Martín <mardani29@yahoo.es>
Commit: Stefan Kangas <stefan@marxist.se>

    Use mouse-wheel-up-event in mwheel-tests.el
    
    Enabling mouse-wheel-mode binds two different mouse events, depending
    on the operating system. The correct way to check for those events is
    by checking mouse-wheel-up-event, as explained in the ELisp manual.
    
    * test/lisp/mwheel-tests.el (mwheel-test-enable/disable): Check
    mouse-wheel-up-event instead of mouse-4 to make the test work
    irrespective of the platform it's running.
---
 test/lisp/mwheel-tests.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/lisp/mwheel-tests.el b/test/lisp/mwheel-tests.el
index fd998fd..315f25e 100644
--- a/test/lisp/mwheel-tests.el
+++ b/test/lisp/mwheel-tests.el
@@ -24,9 +24,9 @@
 
 (ert-deftest mwheel-test-enable/disable ()
   (mouse-wheel-mode 1)
-  (should (eq (lookup-key (current-global-map) '[mouse-4]) 'mwheel-scroll))
+  (should (eq (lookup-key (current-global-map) `[,mouse-wheel-up-event]) 
'mwheel-scroll))
   (mouse-wheel-mode -1)
-  (should (eq (lookup-key (current-global-map) '[mouse-4]) nil)))
+  (should (eq (lookup-key (current-global-map) `[,mouse-wheel-up-event]) nil)))
 
 (ert-deftest mwheel-test--create-scroll-keys ()
   (should (equal (mouse-wheel--create-scroll-keys 10 'mouse-4)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]