MCPcopy Create free account
hub / github.com/dim-an/cod / TestMultipleFlagOccurrences

Function TestMultipleFlagOccurrences

parse_doc/parse_help_test.go:223–245  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

221}
222
223func TestMultipleFlagOccurrences(t *testing.T) {
224 fooHelp := `
225 usage: foo <flags>
226
227 --help show help
228 --foo some stuff
229 --bar other stuff (see also --foo)
230`
231
232 desc, err := ParseHelp([]string{"foo", "--help"}, fooHelp)
233 require.Nil(t, err)
234
235 expected := datastore.HelpPage{
236 ExecutablePath: "foo",
237 Completions: []datastore.Completion{
238 {Flag: "--help"},
239 {Flag: "--foo"},
240 {Flag: "--bar"},
241 },
242 CheckSum: "1f32a5ebf4758e9a89fca0b0de6aed8761cf6f92",
243 }
244 require.Equal(t, expected, *desc)
245}
246
247func TestJavaStyleInclusion(t *testing.T) {
248 fooHelp := `

Callers

nothing calls this directly

Calls 1

ParseHelpFunction · 0.85

Tested by

no test coverage detected