MCPcopy
hub / github.com/spf13/pflag / TestEmptySSValue

Function TestEmptySSValue

string_slice_test.go:42–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestEmptySSValue(t *testing.T) {
43 var ss []string
44 f := setUpSSFlagSet(&ss)
45 err := f.Parse([]string{"--ss="})
46 if err != nil {
47 t.Fatal("expected no error; got", err)
48 }
49
50 getSS, err := f.GetStringSlice("ss")
51 if err != nil {
52 t.Fatal("got an error from GetStringSlice():", err)
53 }
54 if len(getSS) != 0 {
55 t.Fatalf("got ss %v with len=%d but expected length=0", getSS, len(getSS))
56 }
57}
58
59func TestSS(t *testing.T) {
60 var ss []string

Callers

nothing calls this directly

Calls 3

setUpSSFlagSetFunction · 0.85
GetStringSliceMethod · 0.80
ParseMethod · 0.65

Tested by

no test coverage detected