aboutsummaryrefslogtreecommitdiffstats
path: root/config/binds_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/binds_test.go')
-rw-r--r--config/binds_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/config/binds_test.go b/config/binds_test.go
index 7d4cd779..7325252d 100644
--- a/config/binds_test.go
+++ b/config/binds_test.go
@@ -85,3 +85,17 @@ func TestGetBinding(t *testing.T) {
{vaxis.ModShift, vaxis.KeyUp},
}, BINDING_FOUND, ":open")
}
+
+func TestKeyStrokeFormatting(t *testing.T) {
+ tests := []struct {
+ stroke KeyStroke
+ formatted string
+ }{
+ {KeyStroke{vaxis.ModifierMask(0), vaxis.KeyLeft}, "<left>"},
+ {KeyStroke{vaxis.ModCtrl, vaxis.KeyLeft}, "c-<left>"},
+ }
+
+ for _, test := range tests {
+ assert.Equal(t, test.formatted, FormatKeyStrokes([]KeyStroke{test.stroke}))
+ }
+}