aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2021-02-21 22:08:01 +0100
committerAndrea Corallo2021-02-21 22:08:01 +0100
commitcf1e8e792f60949e09e3ad4c53fb61b0b7628229 (patch)
tree35080229c9e3b46e5db14a2f051c001ab8c6e586 /test/src
parent39792cf62987ecc1a772f6a2027d6b32c70e8312 (diff)
parentd0c47652e527397cae96444c881bf60455c763c1 (diff)
downloademacs-cf1e8e792f60949e09e3ad4c53fb61b0b7628229.tar.gz
emacs-cf1e8e792f60949e09e3ad4c53fb61b0b7628229.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/src')
-rw-r--r--test/src/keyboard-tests.el39
1 files changed, 31 insertions, 8 deletions
diff --git a/test/src/keyboard-tests.el b/test/src/keyboard-tests.el
index 607d2eafd45..41c8cdd15f0 100644
--- a/test/src/keyboard-tests.el
+++ b/test/src/keyboard-tests.el
@@ -23,14 +23,15 @@
23 23
24(ert-deftest keyboard-unread-command-events () 24(ert-deftest keyboard-unread-command-events ()
25 "Test `unread-command-events'." 25 "Test `unread-command-events'."
26 (should (equal (progn (push ?\C-a unread-command-events) 26 (let ((unread-command-events nil))
27 (read-event nil nil 1)) 27 (should (equal (progn (push ?\C-a unread-command-events)
28 ?\C-a)) 28 (read-event nil nil 1))
29 (should (equal (progn (run-with-timer 29 ?\C-a))
30 1 nil 30 (should (equal (progn (run-with-timer
31 (lambda () (push '(t . ?\C-b) unread-command-events))) 31 1 nil
32 (read-event nil nil 2)) 32 (lambda () (push '(t . ?\C-b) unread-command-events)))
33 ?\C-b))) 33 (read-event nil nil 2))
34 ?\C-b))))
34 35
35(ert-deftest keyboard-lossage-size () 36(ert-deftest keyboard-lossage-size ()
36 "Test `lossage-size'." 37 "Test `lossage-size'."
@@ -46,6 +47,28 @@
46 (should-error (lossage-size (1- min-value))) 47 (should-error (lossage-size (1- min-value)))
47 (should (= lossage-orig (lossage-size lossage-orig))))) 48 (should (= lossage-orig (lossage-size lossage-orig)))))
48 49
50;; FIXME: This test doesn't currently work :-(
51;; (ert-deftest keyboard-tests--echo-keystrokes-bug15332 ()
52;; (let ((msgs '())
53;; (unread-command-events nil)
54;; (redisplay--interactive t)
55;; (echo-keystrokes 2))
56;; (setq unread-command-events '(?\C-u))
57;; (let* ((timer1
58;; (run-with-timer 3 1
59;; (lambda ()
60;; (setq unread-command-events '(?5)))))
61;; (timer2
62;; (run-with-timer 2.5 1
63;; (lambda ()
64;; (push (current-message) msgs)))))
65;; (run-with-timer 5 nil
66;; (lambda ()
67;; (cancel-timer timer1)
68;; (cancel-timer timer2)
69;; (throw 'exit msgs)))
70;; (recursive-edit)
71;; (should (equal msgs '("C-u 55-" "C-u 5-" "C-u-"))))))
49 72
50(provide 'keyboard-tests) 73(provide 'keyboard-tests)
51;;; keyboard-tests.el ends here 74;;; keyboard-tests.el ends here