summaryrefslogtreecommitdiff
path: root/src/options_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go26
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)
+ }
+ }
+}