diff options
| author | raven <citrons@mondecitronne.com> | 2026-02-20 13:42:12 -0600 |
|---|---|---|
| committer | raven <citrons@mondecitronne.com> | 2026-02-20 13:46:59 -0600 |
| commit | 5b6196ebe67cf954bae8212c1a33b869da723e11 (patch) | |
| tree | dce33c06621847c3862e64bda914b1e8a450317d /tui/termfo/keys/key_test.go | |
| parent | 05c068749740f9430d1fda7698c433697eef1652 (diff) | |
support builtin terminfo
copy termfo into the repository and modify it to embed an xterm terminfo to as
a fallback
Diffstat (limited to 'tui/termfo/keys/key_test.go')
| -rw-r--r-- | tui/termfo/keys/key_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tui/termfo/keys/key_test.go b/tui/termfo/keys/key_test.go new file mode 100644 index 0000000..2536ddf --- /dev/null +++ b/tui/termfo/keys/key_test.go @@ -0,0 +1,31 @@ +package keys + +import ( + "testing" +) + +func TestKey(t *testing.T) { + t.Skip() + tests := []struct { + k Key + want string + }{ + {'a', "<a>"}, + {'a' | Shift, "<S-a>"}, + {'a' | Ctrl | Shift, "<S-C-a>"}, + {'a' | Ctrl | Shift | Alt, "<S-C-A-a>"}, + {Tab, "<Tab>"}, + {Tab | Ctrl, "<C-Tab>"}, + {Up, "<Up>"}, + {Up | Ctrl, "<C-Up>"}, + } + + for _, tt := range tests { + t.Run("", func(t *testing.T) { + h := tt.k.String() + if h != tt.want { + t.Errorf("\nwant: %s\nhave: %s", tt.want, h) + } + }) + } +} |
