MCPcopy
hub / github.com/mislav/hub / TestArgsParser_RepeatedArg

Function TestArgsParser_RepeatedArg

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

Source from the content-addressed store, hash-verified

158}
159
160func TestArgsParser_RepeatedArg(t *testing.T) {
161 p := NewArgsParser()
162 p.RegisterValue("--msg", "-m")
163 args := []string{"--msg=hello", "-m", "world", "--msg", "how", "-mare you?"}
164 rest, err := p.Parse(args)
165 equal(t, nil, err)
166 equal(t, []string{}, rest)
167 equal(t, "are you?", p.Value("--msg"))
168 equal(t, []string{"hello", "world", "how", "are you?"}, p.AllValues("--msg"))
169}
170
171func TestArgsParser_Int(t *testing.T) {
172 p := NewArgsParser()

Callers

nothing calls this directly

Calls 6

RegisterValueMethod · 0.95
ParseMethod · 0.95
ValueMethod · 0.95
AllValuesMethod · 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…