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:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user