From 6e4e76655db5df5edd7c381bc8b7d224284d361b Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Tue, 15 Sep 2015 18:02:03 -0400 Subject: [PATCH] More error output if a could of _test fail --- cobra_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cobra_test.go b/cobra_test.go index 3f019837..8b433803 100644 --- a/cobra_test.go +++ b/cobra_test.go @@ -632,10 +632,10 @@ func TestNonRunChildHelp(t *testing.T) { } func TestRunnableRootCommand(t *testing.T) { - fullSetupTest("") + x := fullSetupTest("") 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.SetArgs(empty_arg) - c.Execute() + err := c.Execute() + if err != nil { + t.Errorf("Execute() failed with %v", err) + } if rootcalled != true { t.Errorf("Root Function was not called")