From 1f3e0b52339258611596d10319d35d1e9f38bc55 Mon Sep 17 00:00:00 2001 From: Irioth Date: Thu, 18 Jun 2020 01:02:47 +0300 Subject: [PATCH] make test more general and stable --- command_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/command_test.go b/command_test.go index c1d106d..a3c3b84 100644 --- a/command_test.go +++ b/command_test.go @@ -386,11 +386,10 @@ func TestCommand_NoVersionFlagOnCommands(t *testing.T) { Name: "bar", Usage: "this is for testing", Subcommands: []*Command{{}}, // some subcommand + HideHelp: true, Action: func(c *Context) error { - for _, f := range c.App.VisibleFlags() { - if f == VersionFlag { - t.Fatalf("unexpected version flag") - } + if len(c.App.VisibleFlags()) != 0 { + t.Fatalf("unexpected flag on command") } return nil },