1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Validate keys of custom commands

This commit is contained in:
Stefan Haller
2025-02-16 16:19:15 +01:00
parent a5f78d3222
commit 5979b40546
2 changed files with 38 additions and 0 deletions

View File

@ -56,6 +56,24 @@ func TestUserConfigValidate_enums(t *testing.T) {
{value: "1,2,3,4,5,6", valid: false},
},
},
{
name: "Custom command keybinding",
setup: func(config *UserConfig, value string) {
config.CustomCommands = []CustomCommand{
{
Key: value,
Command: "echo 'hello'",
},
}
},
testCases: []testCase{
{value: "", valid: true},
{value: "<disabled>", valid: true},
{value: "q", valid: true},
{value: "<c-c>", valid: true},
{value: "invalid_value", valid: false},
},
},
}
for _, s := range scenarios {