make test more general and stable

main
Irioth 4 years ago
parent 44371a2ac6
commit 1f3e0b5233

@ -386,11 +386,10 @@ func TestCommand_NoVersionFlagOnCommands(t *testing.T) {
Name: "bar", Name: "bar",
Usage: "this is for testing", Usage: "this is for testing",
Subcommands: []*Command{{}}, // some subcommand Subcommands: []*Command{{}}, // some subcommand
HideHelp: true,
Action: func(c *Context) error { Action: func(c *Context) error {
for _, f := range c.App.VisibleFlags() { if len(c.App.VisibleFlags()) != 0 {
if f == VersionFlag { t.Fatalf("unexpected flag on command")
t.Fatalf("unexpected version flag")
}
} }
return nil return nil
}, },

Loading…
Cancel
Save