diff options
| author | Stefan Monnier | 2018-01-30 17:37:20 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2018-01-30 17:37:20 -0500 |
| commit | 2b0bcbbaa64f95c14deed89fdf279d8be48ee352 (patch) | |
| tree | b4008939688fee5811d7dfbbb376fe2ef19827c8 | |
| parent | 386c2ebb58c403c647a1dae1314be4b9f2071f56 (diff) | |
| download | emacs-2b0bcbbaa64f95c14deed89fdf279d8be48ee352.tar.gz emacs-2b0bcbbaa64f95c14deed89fdf279d8be48ee352.zip | |
* test/lisp/mouse-tests.el: Fix tests broken by mouse.el change
* test/lisp/mouse-tests.el (bug23288-use-return-value)
(bug23288-translate-to-mouse-2): Don't rely as much on details of the
implementation, so it also works with the new code.
| -rw-r--r-- | test/lisp/mouse-tests.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/lisp/mouse-tests.el b/test/lisp/mouse-tests.el index 639ccf78a9f..909ba64a724 100644 --- a/test/lisp/mouse-tests.el +++ b/test/lisp/mouse-tests.el | |||
| @@ -27,24 +27,22 @@ | |||
| 27 | 27 | ||
| 28 | (ert-deftest bug23288-use-return-value () | 28 | (ert-deftest bug23288-use-return-value () |
| 29 | "If `mouse-on-link-p' returns a string, its first character is used." | 29 | "If `mouse-on-link-p' returns a string, its first character is used." |
| 30 | (cl-letf ((last-input-event '(down-mouse-1 nil 1)) | 30 | (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1))) |
| 31 | (unread-command-events '((mouse-1 nil 1))) | ||
| 32 | (mouse-1-click-follows-link t) | 31 | (mouse-1-click-follows-link t) |
| 33 | (mouse-1-click-in-non-selected-windows t) | 32 | (mouse-1-click-in-non-selected-windows t) |
| 34 | ((symbol-function 'mouse-on-link-p) (lambda (_pos) "abc"))) | 33 | ((symbol-function 'mouse-on-link-p) (lambda (_pos) "abc"))) |
| 35 | (should-not (mouse--down-1-maybe-follows-link)) | 34 | (should (eq 'down-mouse-1 (car-safe (aref (read-key-sequence "") 0)))) |
| 36 | (should (equal unread-command-events '(?a))))) | 35 | (should (eq ?a (aref (read-key-sequence "") 0))))) |
| 37 | 36 | ||
| 38 | (ert-deftest bug23288-translate-to-mouse-2 () | 37 | (ert-deftest bug23288-translate-to-mouse-2 () |
| 39 | "If `mouse-on-link-p' doesn't return a string or vector, | 38 | "If `mouse-on-link-p' doesn't return a string or vector, |
| 40 | translate `mouse-1' events into `mouse-2' events." | 39 | translate `mouse-1' events into `mouse-2' events." |
| 41 | (cl-letf ((last-input-event '(down-mouse-1 nil 1)) | 40 | (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1))) |
| 42 | (unread-command-events '((mouse-1 nil 1))) | ||
| 43 | (mouse-1-click-follows-link t) | 41 | (mouse-1-click-follows-link t) |
| 44 | (mouse-1-click-in-non-selected-windows t) | 42 | (mouse-1-click-in-non-selected-windows t) |
| 45 | ((symbol-function 'mouse-on-link-p) (lambda (_pos) t))) | 43 | ((symbol-function 'mouse-on-link-p) (lambda (_pos) t))) |
| 46 | (should-not (mouse--down-1-maybe-follows-link)) | 44 | (should (eq 'down-mouse-1 (car-safe (aref (read-key-sequence "") 0)))) |
| 47 | (should (equal unread-command-events '((mouse-2 nil 1)))))) | 45 | (should (eq 'mouse-2 (car-safe (aref (read-key-sequence "") 0)))))) |
| 48 | 46 | ||
| 49 | (ert-deftest bug26816-mouse-frame-movement () | 47 | (ert-deftest bug26816-mouse-frame-movement () |
| 50 | "Mouse moves relative to frame." | 48 | "Mouse moves relative to frame." |