MCPcopy
hub / github.com/mislav/hub / TestArgsParser_Values

Function TestArgsParser_Values

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

Source from the content-addressed store, hash-verified

79}
80
81func TestArgsParser_Values(t *testing.T) {
82 p := NewArgsParser()
83 p.RegisterValue("--origin", "-o")
84 args := []string{"--origin=a=b", "--origin=", "--origin", "c", "-o"}
85 rest, err := p.Parse(args)
86 equal(t, errors.New("no value given for '-o'"), err)
87 equal(t, []string{}, rest)
88 equal(t, []string{"a=b", "", "c"}, p.AllValues("--origin"))
89}
90
91func TestArgsParser_Bool(t *testing.T) {
92 p := NewArgsParser()

Callers

nothing calls this directly

Calls 5

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