From e8cdf76fbfaa6bd6c79b7a44a22e277c62781c9e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 22 Jul 2022 21:12:45 -0700 Subject: Move a couple of keybindings to herbstluftwm --- test/kbd.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/kbd.scm (limited to 'test') diff --git a/test/kbd.scm b/test/kbd.scm new file mode 100644 index 0000000..52eb3d3 --- /dev/null +++ b/test/kbd.scm @@ -0,0 +1,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 `' key is converted to `BackSpace'" + "Mod1-BackSpace" (kbd "M-")) + +(test-end "kbd-test") -- cgit v1.2.3-54-g00ecf