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

Function TestJavaStyleInclusion

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

Source from the content-addressed store, hash-verified

245}
246
247func TestJavaStyleInclusion(t *testing.T) {
248 fooHelp := `
249 usage: foo <flags>
250
251 --help show help
252 -v --verbose be verbose
253 -E --expand expand something
254 -T --text expand something
255 -a same as -vET
256`
257
258 desc, err := ParseHelp([]string{"foo", "--help"}, fooHelp)
259 require.Nil(t, err)
260
261 expected := datastore.HelpPage{
262 ExecutablePath: "foo",
263 Completions: []datastore.Completion{
264 {Flag: "--help"},
265 {Flag: "-v"},
266 {Flag: "--verbose"},
267 {Flag: "-E"},
268 {Flag: "--expand"},
269 {Flag: "-T"},
270 {Flag: "--text"},
271 {Flag: "-a"},
272 },
273 CheckSum: "ab2bce9df3ee2ff08f41d3c8142f5e52ad6c1686",
274 }
275 require.Equal(t, expected, *desc)
276}
277
278func TestJavaStyle(t *testing.T) {
279 fooHelp := `

Callers

nothing calls this directly

Calls 1

ParseHelpFunction · 0.85

Tested by

no test coverage detected