summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-26 06:55:06 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-26 06:56:04 +0100
commit6866cf9c375777441c996a0217b8b573657207fb (patch)
treefdf22dbbfbc6cda82de9c589b1455d801b7790fb
parent101bbd1392077e26e904c70fead7f7d7dce595f7 (diff)
downloademacs-6866cf9c375777441c996a0217b8b573657207fb.tar.gz
Add test for text-char-description
* test/src/keymap-tests.el (keymap-text-char-description): New test.
-rw-r--r--test/src/keymap-tests.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index 629d6c55849..bee48351e15 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -407,6 +407,21 @@ g .. h foo
(define-key child [?a] nil t)
(should (eq (lookup-key child [?a]) 'foo))))
+(ert-deftest keymap-text-char-description ()
+ (should (equal (text-char-description ?a) "a"))
+ (should (equal (text-char-description ?\s) " "))
+ (should (equal (text-char-description ?\t) "^I"))
+ (should (equal (text-char-description ?\^C) "^C"))
+ (should (equal (text-char-description ?\^?) "^?"))
+ (should (equal (text-char-description #x80) "€"))
+ (should (equal (text-char-description ?å) "å"))
+ (should (equal (text-char-description ?Ş) "Ş"))
+ (should (equal (text-char-description ?Ā) "Ā"))
+ (should-error (text-char-description "c"))
+ (should-error (text-char-description [?\C-x ?l]))
+ (should-error (text-char-description ?\M-c))
+ (should-error (text-char-description ?\s-c)))
+
(provide 'keymap-tests)
;;; keymap-tests.el ends here