diff options
| author | Daniel MartÃn | 2020-09-08 14:18:17 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-09-08 18:31:15 +0200 |
| commit | 3e5259a268d423ef3b6a0ffcfe05ac623bbe7f25 (patch) | |
| tree | ca97a31e1c7988abd255cc253cf91cf72a641c6e | |
| parent | 7865b4044d7520bcf4053ef5d763019dae499a08 (diff) | |
| download | emacs-3e5259a268d423ef3b6a0ffcfe05ac623bbe7f25.tar.gz emacs-3e5259a268d423ef3b6a0ffcfe05ac623bbe7f25.zip | |
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.
| -rw-r--r-- | test/lisp/mwheel-tests.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lisp/mwheel-tests.el b/test/lisp/mwheel-tests.el index fd998fd4f0e..315f25edae8 100644 --- a/test/lisp/mwheel-tests.el +++ b/test/lisp/mwheel-tests.el | |||
| @@ -24,9 +24,9 @@ | |||
| 24 | 24 | ||
| 25 | (ert-deftest mwheel-test-enable/disable () | 25 | (ert-deftest mwheel-test-enable/disable () |
| 26 | (mouse-wheel-mode 1) | 26 | (mouse-wheel-mode 1) |
| 27 | (should (eq (lookup-key (current-global-map) '[mouse-4]) 'mwheel-scroll)) | 27 | (should (eq (lookup-key (current-global-map) `[,mouse-wheel-up-event]) 'mwheel-scroll)) |
| 28 | (mouse-wheel-mode -1) | 28 | (mouse-wheel-mode -1) |
| 29 | (should (eq (lookup-key (current-global-map) '[mouse-4]) nil))) | 29 | (should (eq (lookup-key (current-global-map) `[,mouse-wheel-up-event]) nil))) |
| 30 | 30 | ||
| 31 | (ert-deftest mwheel-test--create-scroll-keys () | 31 | (ert-deftest mwheel-test--create-scroll-keys () |
| 32 | (should (equal (mouse-wheel--create-scroll-keys 10 'mouse-4) | 32 | (should (equal (mouse-wheel--create-scroll-keys 10 'mouse-4) |