Make pointer and multi-select marker customizable (#1844)

Add --pointer and --marker option which can provide additional context to the user
This commit is contained in:
Hiroki Konishi
2020-02-17 10:19:03 +09:00
committed by GitHub
parent d61ac32d7b
commit 2a60edcd52
6 changed files with 203 additions and 73 deletions

View File

@@ -422,3 +422,29 @@ func TestAdditiveExpect(t *testing.T) {
t.Error(opts.Expect)
}
}
func TestValidateSign(t *testing.T) {
testCases := []struct {
inputSign string
isValid bool
}{
{"> ", true},
{"아", true},
{"😀", true},
{"", false},
{">>>", false},
{"\n", false},
{"\t", false},
}
for _, testCase := range testCases {
err := validateSign(testCase.inputSign, "")
if testCase.isValid && err != nil {
t.Errorf("Input sign `%s` caused error", testCase.inputSign)
}
if !testCase.isValid && err == nil {
t.Errorf("Input sign `%s` did not cause error", testCase.inputSign)
}
}
}