test: avoid output from "go test" when tests pass

Some tests where printing to os.Stdout as a side effect even if the
output was not used/checked in the test.
This commit is contained in:
Håvard Haugen
2015-11-28 18:26:10 +01:00
parent 0302d3914d
commit 7b94fd3aad
2 changed files with 4 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package cli
import (
"errors"
"flag"
"io/ioutil"
"testing"
)
@@ -20,6 +21,7 @@ func TestCommandFlagParsing(t *testing.T) {
for _, c := range cases {
app := NewApp()
app.Writer = ioutil.Discard
set := flag.NewFlagSet("test", 0)
set.Parse(c.testArgs)