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

Function TestEmptyUIS

uint_slice_test.go:22–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestEmptyUIS(t *testing.T) {
23 var uis []uint
24 f := setUpUISFlagSet(&uis)
25 err := f.Parse([]string{})
26 if err != nil {
27 t.Fatal("expected no error; got", err)
28 }
29
30 getUIS, err := f.GetUintSlice("uis")
31 if err != nil {
32 t.Fatal("got an error from GetUintSlice():", err)
33 }
34 if len(getUIS) != 0 {
35 t.Fatalf("got is %v with len=%d but expected length=0", getUIS, len(getUIS))
36 }
37}
38
39func TestUIS(t *testing.T) {
40 var uis []uint

Callers

nothing calls this directly

Calls 3

setUpUISFlagSetFunction · 0.85
GetUintSliceMethod · 0.80
ParseMethod · 0.65

Tested by

no test coverage detected