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

Function TestOptionInVeryBeginningOfLine

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

Source from the content-addressed store, hash-verified

305}
306
307func TestOptionInVeryBeginningOfLine(t *testing.T) {
308 fooHelp := `
309usage: foo <flags>
310
311-h show help
312--foo foo option
313`
314
315 desc, err := ParseHelp([]string{"foo", "-h"}, fooHelp)
316 require.Nil(t, err)
317
318 expected := datastore.HelpPage{
319 ExecutablePath: "foo",
320 Completions: []datastore.Completion{
321 {Flag: "-h"},
322 {Flag: "--foo"}, // it might be
323 },
324 CheckSum: "da4c610510f4addb1089ae41896d09bfd0ccd790",
325 }
326 require.Equal(t, expected, *desc)
327}

Callers

nothing calls this directly

Calls 1

ParseHelpFunction · 0.85

Tested by

no test coverage detected