]> git.eshelyaron.com Git - emacs.git/commitdiff
Use mouse-wheel-up-event in mwheel-tests.el
authorDaniel Martín <mardani29@yahoo.es>
Tue, 8 Sep 2020 12:18:17 +0000 (14:18 +0200)
committerStefan Kangas <stefan@marxist.se>
Tue, 8 Sep 2020 16:31:15 +0000 (18:31 +0200)
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

index fd998fd4f0e99ce3625a47ce32dd3a677f071605..315f25edae89ef7401b9c8950f641d717b2bdbce 100644 (file)
@@ -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)