emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 2b0bcbb: * test/lisp/mouse-tests.el: Fix tests brok


From: Stefan Monnier
Subject: [Emacs-diffs] master 2b0bcbb: * test/lisp/mouse-tests.el: Fix tests broken by mouse.el change
Date: Tue, 30 Jan 2018 17:37:26 -0500 (EST)

branch: master
commit 2b0bcbbaa64f95c14deed89fdf279d8be48ee352
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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.
---
 test/lisp/mouse-tests.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/test/lisp/mouse-tests.el b/test/lisp/mouse-tests.el
index 639ccf7..909ba64 100644
--- a/test/lisp/mouse-tests.el
+++ b/test/lisp/mouse-tests.el
@@ -27,24 +27,22 @@
 
 (ert-deftest bug23288-use-return-value ()
   "If `mouse-on-link-p' returns a string, its first character is used."
-  (cl-letf ((last-input-event '(down-mouse-1 nil 1))
-            (unread-command-events '((mouse-1 nil 1)))
+  (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1)))
             (mouse-1-click-follows-link t)
             (mouse-1-click-in-non-selected-windows t)
             ((symbol-function 'mouse-on-link-p) (lambda (_pos) "abc")))
-    (should-not (mouse--down-1-maybe-follows-link))
-    (should (equal unread-command-events '(?a)))))
+    (should (eq 'down-mouse-1 (car-safe (aref (read-key-sequence "") 0))))
+    (should (eq ?a (aref (read-key-sequence "") 0)))))
 
 (ert-deftest bug23288-translate-to-mouse-2 ()
   "If `mouse-on-link-p' doesn't return a string or vector,
 translate `mouse-1' events into `mouse-2' events."
-  (cl-letf ((last-input-event '(down-mouse-1 nil 1))
-            (unread-command-events '((mouse-1 nil 1)))
+  (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1)))
             (mouse-1-click-follows-link t)
             (mouse-1-click-in-non-selected-windows t)
             ((symbol-function 'mouse-on-link-p) (lambda (_pos) t)))
-    (should-not (mouse--down-1-maybe-follows-link))
-    (should (equal unread-command-events '((mouse-2 nil 1))))))
+    (should (eq 'down-mouse-1 (car-safe (aref (read-key-sequence "") 0))))
+    (should (eq 'mouse-2 (car-safe (aref (read-key-sequence "") 0))))))
 
 (ert-deftest bug26816-mouse-frame-movement ()
   "Mouse moves relative to frame."



reply via email to

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