diff options
author | Hiroki Konishi <relastle@gmail.com> | 2020-02-17 10:19:03 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-17 10:19:03 +0900 |
commit | 2a60edcd52df0c913ea8a93efec4027b9a758a5b (patch) | |
tree | 6ff74c8dd9996ad0f5a621c0175ccad18c2b55b4 /src/options_test.go | |
parent | d61ac32d7b5f1ba0c98c5fff3ec33f76c865e96e (diff) |
Make pointer and multi-select marker customizable (#1844)
Add --pointer and --marker option which can provide additional context to the user
Diffstat (limited to 'src/options_test.go')
-rw-r--r-- | src/options_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/options_test.go b/src/options_test.go index 66d7c8f5..b312be11 100644 --- a/src/options_test.go +++ b/src/options_test.go @@ -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) + } + } +} |