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

Function TestImplicitTrue

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

Source from the content-addressed store, hash-verified

76}
77
78func TestImplicitTrue(t *testing.T) {
79 var tristate triStateValue
80 f := setUpFlagSet(&tristate)
81 err := f.Parse([]string{"--tristate"})
82 if err != nil {
83 t.Fatal("expected no error; got", err)
84 }
85 if tristate != triStateTrue {
86 t.Fatal("expected", triStateTrue, "(triStateTrue) but got", tristate, "instead")
87 }
88}
89
90func TestShortFlag(t *testing.T) {
91 var tristate triStateValue

Callers

nothing calls this directly

Calls 2

setUpFlagSetFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected