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

Function TestEmptyS2S

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

setUpS2SFlagSetFunction · 0.85
GetStringToStringMethod · 0.80
ParseMethod · 0.65

Tested by

no test coverage detected