Skip to content

Commit f87d093

Browse files
committed
Add tests
1 parent 2bd3c5f commit f87d093

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

args_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,33 @@ func TestArgumentsSubcommand(t *testing.T) {
328328
}
329329
}
330330

331+
func TestArgUsage(t *testing.T) {
332+
arg := &IntArg{
333+
Name: "ia",
334+
}
335+
tests := []struct {
336+
name string
337+
usage string
338+
expected string
339+
}{
340+
{
341+
name: "default",
342+
expected: "ia",
343+
},
344+
{
345+
name: "usage",
346+
usage: "foo-usage",
347+
expected: "foo-usage",
348+
},
349+
}
350+
for _, test := range tests {
351+
t.Run(test.name, func(t *testing.T) {
352+
arg.UsageText = test.usage
353+
require.Equal(t, test.expected, arg.Usage())
354+
})
355+
}
356+
}
357+
331358
func TestArgsUsage(t *testing.T) {
332359
arg := &IntArgs{
333360
Name: "ia",

0 commit comments

Comments
 (0)