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

Function TestExplicitMaybe

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

Source from the content-addressed store, hash-verified

117}
118
119func TestExplicitMaybe(t *testing.T) {
120 var tristate triStateValue
121 f := setUpFlagSet(&tristate)
122 err := f.Parse([]string{"--tristate=maybe"})
123 if err != nil {
124 t.Fatal("expected no error; got", err)
125 }
126 if tristate != triStateMaybe {
127 t.Fatal("expected", triStateMaybe, "(triStateMaybe) but got", tristate, "instead")
128 }
129}
130
131func TestExplicitFalse(t *testing.T) {
132 var tristate triStateValue

Callers

nothing calls this directly

Calls 2

setUpFlagSetFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected