MCPcopy
hub / github.com/mislav/hub / TestArgsParser_BoolValue

Function TestArgsParser_BoolValue

utils/args_parser_test.go:109–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func TestArgsParser_BoolValue(t *testing.T) {
110 p := NewArgsParser()
111 p.RegisterBool("--draft")
112 args := []string{"--draft=yes pls"}
113 rest, err := p.Parse(args)
114 equal(t, nil, err)
115 equal(t, []string{}, rest)
116 equal(t, true, p.HasReceived("--draft"))
117 equal(t, true, p.Bool("--draft"))
118 equal(t, "yes pls", p.Value("--draft"))
119}
120
121func TestArgsParser_Shorthand(t *testing.T) {
122 p := NewArgsParser()

Callers

nothing calls this directly

Calls 7

RegisterBoolMethod · 0.95
ParseMethod · 0.95
HasReceivedMethod · 0.95
BoolMethod · 0.95
ValueMethod · 0.95
NewArgsParserFunction · 0.85
equalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…