dotfiles/test/kbd.scm

28 lines
939 B
Scheme

(define-module (test kbd)
#:use-module (srfi srfi-64)
#:use-module (oni kbd))
(test-begin "kbd-test")
(test-equal "Any letter alone is untouched"
"s" (kbd "s"))
(test-equal "The `s' modifier is converted to `Mod4'"
"Mod4-s" (kbd "s-s"))
(test-equal "The `S' modifier is converted to `Shift'"
"Shift-s" (kbd "S-s"))
(test-equal "The `M' modifier is converted to `Mod1'"
"Mod1-x" (kbd "M-x"))
(test-equal "The `C' modifier is converted to `Ctrl'"
"Ctrl-f" (kbd "C-f"))
(test-equal "Two modifiers can be combined"
"Mod4-Shift-q" (kbd "s-S-q"))
(test-equal "Three modifiers can be combined"
"Mod4-Shift-Ctrl-f" (kbd "s-S-C-f"))
(test-equal "The `RET' key is converted to `Return'"
"Mod4-Return" (kbd "s-RET"))
(test-equal "The `SPC' key is converted to `space'"
"Ctrl-space" (kbd "C-SPC"))
(test-equal "The `<backspace>' key is converted to `BackSpace'"
"Mod1-BackSpace" (kbd "M-<backspace>"))
(test-end "kbd-test")