From 55b10c78ccee1af388cc70845384387b433dfd42 Mon Sep 17 00:00:00 2001 From: devinnwang Date: Tue, 25 Oct 2022 14:39:38 +0800 Subject: [PATCH] add case --- command_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/command_test.go b/command_test.go index 76c5399de8..478c3251a6 100644 --- a/command_test.go +++ b/command_test.go @@ -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 }, }, @@ -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")) }