aboutsummaryrefslogtreecommitdiffstats
path: root/test/kbd.scm
blob: 52eb3d344d2b650609b405251d76f976ad33e326 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(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")