mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
More error output if a could of _test fail
This commit is contained in:
parent
6d70311770
commit
6e4e76655d
1 changed files with 6 additions and 3 deletions
|
@ -632,10 +632,10 @@ func TestNonRunChildHelp(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRunnableRootCommand(t *testing.T) {
|
func TestRunnableRootCommand(t *testing.T) {
|
||||||
fullSetupTest("")
|
x := fullSetupTest("")
|
||||||
|
|
||||||
if rootcalled != true {
|
if rootcalled != true {
|
||||||
t.Errorf("Root Function was not called")
|
t.Errorf("Root Function was not called\n out:%v", x.Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +650,10 @@ func TestRunnableRootCommandNilInput(t *testing.T) {
|
||||||
c.AddCommand(cmdPrint, cmdEcho)
|
c.AddCommand(cmdPrint, cmdEcho)
|
||||||
c.SetArgs(empty_arg)
|
c.SetArgs(empty_arg)
|
||||||
|
|
||||||
c.Execute()
|
err := c.Execute()
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Execute() failed with %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
if rootcalled != true {
|
if rootcalled != true {
|
||||||
t.Errorf("Root Function was not called")
|
t.Errorf("Root Function was not called")
|
||||||
|
|
Loading…
Reference in a new issue