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

Function TestImplicitFalse

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

Source from the content-addressed store, hash-verified

141}
142
143func TestImplicitFalse(t *testing.T) {
144 var tristate triStateValue
145 f := setUpFlagSet(&tristate)
146 err := f.Parse([]string{})
147 if err != nil {
148 t.Fatal("expected no error; got", err)
149 }
150 if tristate != triStateFalse {
151 t.Fatal("expected", triStateFalse, "(triStateFalse) but got", tristate, "instead")
152 }
153}
154
155func TestInvalidValue(t *testing.T) {
156 var tristate triStateValue

Callers

nothing calls this directly

Calls 2

setUpFlagSetFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected