aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/src/keyboard-tests.el34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/src/keyboard-tests.el b/test/src/keyboard-tests.el
new file mode 100644
index 00000000000..d2063a38c14
--- /dev/null
+++ b/test/src/keyboard-tests.el
@@ -0,0 +1,34 @@
1;;; keyboard-tests.el --- Tests for keyboard.c -*- lexical-binding: t -*-
2
3;; Copyright 2017 Free Software Foundation, Inc.
4
5;; This program is free software; you can redistribute it and/or modify
6;; it under the terms of the GNU General Public License as published by
7;; the Free Software Foundation, either version 3 of the License, or
8;; (at your option) any later version.
9
10;; This program is distributed in the hope that it will be useful,
11;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13;; GNU General Public License for more details.
14
15;; You should have received a copy of the GNU General Public License
16;; along with this program. If not, see <https://www.gnu.org/licenses/>.
17
18;;; Code:
19
20(require 'ert)
21
22(ert-deftest keyboard-unread-command-events ()
23 "Test `unread-command-events'."
24 (should (equal (progn (push ?\C-a unread-command-events)
25 (read-event nil nil 1))
26 ?\C-a))
27 (should (equal (progn (run-with-timer
28 1 nil
29 (lambda () (push '(t . ?\C-b) unread-command-events)))
30 (read-event nil nil 2))
31 ?\C-b)))
32
33(provide 'keyboard-tests)
34;;; keyboard-tests.el ends here