aboutsummaryrefslogtreecommitdiff
path: root/string_slice_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'string_slice_test.go')
-rw-r--r--string_slice_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/string_slice_test.go b/string_slice_test.go
index c7fdc70..ed7cbfc 100644
--- a/string_slice_test.go
+++ b/string_slice_test.go
@@ -39,6 +39,23 @@ func TestEmptySS(t *testing.T) {
}
}
+func TestEmptySSValue(t *testing.T) {
+ var ss []string
+ f := setUpSSFlagSet(&ss)
+ err := f.Parse([]string{"--ss="})
+ if err != nil {
+ t.Fatal("expected no error; got", err)
+ }
+
+ getSS, err := f.GetStringSlice("ss")
+ if err != nil {
+ t.Fatal("got an error from GetStringSlice():", err)
+ }
+ if len(getSS) != 0 {
+ t.Fatalf("got ss %v with len=%d but expected length=0", getSS, len(getSS))
+ }
+}
+
func TestSS(t *testing.T) {
var ss []string
f := setUpSSFlagSet(&ss)