MCPcopy
hub / github.com/urfave/cli / TestArgUsage

Function TestArgUsage

args_test.go:418–443  ·  args_test.go::TestArgUsage
(t *testing.T)

Source from the content-addressed store, hash-verified

416}
417
418func TestArgUsage(t *testing.T) {
419 arg := &IntArg{
420 Name: "ia",
421 }
422 tests := []struct {
423 name string
424 usage string
425 expected string
426 }{
427 {
428 name: "default",
429 expected: "ia",
430 },
431 {
432 name: "usage",
433 usage: "foo-usage",
434 expected: "foo-usage",
435 },
436 }
437 for _, test := range tests {
438 t.Run(test.name, func(t *testing.T) {
439 arg.UsageText = test.usage
440 require.Equal(t, test.expected, arg.Usage())
441 })
442 }
443}
444
445func TestArgsUsage(t *testing.T) {
446 arg := &IntArgs{

Callers

nothing calls this directly

Calls 2

UsageMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected