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

Function TestExplicitTrue

bool_test.go:66–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestExplicitTrue(t *testing.T) {
67 var tristate triStateValue
68 f := setUpFlagSet(&tristate)
69 err := f.Parse([]string{"--tristate=true"})
70 if err != nil {
71 t.Fatal("expected no error; got", err)
72 }
73 if tristate != triStateTrue {
74 t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
75 }
76}
77
78func TestImplicitTrue(t *testing.T) {
79 var tristate triStateValue

Callers

nothing calls this directly

Calls 2

setUpFlagSetFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected