From 2a60edcd52df0c913ea8a93efec4027b9a758a5b Mon Sep 17 00:00:00 2001 From: Hiroki Konishi Date: Mon, 17 Feb 2020 10:19:03 +0900 Subject: Make pointer and multi-select marker customizable (#1844) Add --pointer and --marker option which can provide additional context to the user --- src/options_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/options_test.go') 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) + } + } +} -- cgit v1.2.3