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

Function TestEmptySS

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

Source from the content-addressed store, hash-verified

23}
24
25func TestEmptySS(t *testing.T) {
26 var ss []string
27 f := setUpSSFlagSet(&ss)
28 err := f.Parse([]string{})
29 if err != nil {
30 t.Fatal("expected no error; got", err)
31 }
32
33 getSS, err := f.GetStringSlice("ss")
34 if err != nil {
35 t.Fatal("got an error from GetStringSlice():", err)
36 }
37 if len(getSS) != 0 {
38 t.Fatalf("got ss %v with len=%d but expected length=0", getSS, len(getSS))
39 }
40}
41
42func TestEmptySSValue(t *testing.T) {
43 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