branch: externals/pyim
commit 2d334422e96ed22591bf25ffcae12b025957326c
Author: Feng Shu <[email protected]>
Commit: Feng Shu <[email protected]>
* tests/pyim-tests.el (pyim-tests-pyim-add-unread-command-events): New test.
---
tests/pyim-tests.el | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 183e82f..4196dff 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -116,6 +116,27 @@
'("a-b-c-d" "a-b-c" "a-b")))
(should (equal (pyim-subconcat nil) nil)))
+(ert-deftest pyim-tests-pyim-add-unread-command-events ()
+ (let ((unread-command-events nil))
+ (pyim-add-unread-command-events ?a)
+ (should (equal unread-command-events
+ '((no-record . 97))))
+ (pyim-add-unread-command-events "b")
+ (should (equal unread-command-events
+ '((no-record . 98)
+ (no-record . 97))))
+ (pyim-add-unread-command-events "cd")
+ (should (equal unread-command-events
+ '((no-record . 99)
+ (no-record . 100)
+ (no-record . 98)
+ (no-record . 97))))
+ (pyim-add-unread-command-events "e" t)
+ (should (equal unread-command-events
+ '((no-record . 101))))
+ (pyim-add-unread-command-events nil t)
+ (should (equal unread-command-events nil))))
+
(ert-deftest pyim-tests-pyim-time-limit-while ()
(let ((time (current-time))
(limit 0.1))