Skip to content

Commit

Permalink
add case
Browse files Browse the repository at this point in the history
  • Loading branch information
devinnwang committed Oct 25, 2022
1 parent 246b1c0 commit 55b10c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion command_test.go
Expand Up @@ -502,7 +502,7 @@ func TestCommand_RunSubcommandWithDefault(t *testing.T) {
Name: "bar",
Usage: "this is for testing",
Subcommands: []*Command{{}}, // some subcommand
Action: func(c *Context) error {
Action: func(*Context) error {
return nil
},
},
Expand All @@ -511,4 +511,7 @@ func TestCommand_RunSubcommandWithDefault(t *testing.T) {

err := app.Run([]string{"app", "bar"})
expect(t, err, nil)

err = app.Run([]string{"app"})
expect(t, err, errors.New("should not run this subcommand"))
}

0 comments on commit 55b10c7

Please sign in to comment.