aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bool_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/bool_test.go b/bool_test.go
index 72a12be..19aa762 100644
--- a/bool_test.go
+++ b/bool_test.go
@@ -5,6 +5,7 @@
package pflag_test
import (
+ "bytes"
"fmt"
"strconv"
"testing"
@@ -156,6 +157,8 @@ func TestImplicitFalse(t *testing.T) {
func TestInvalidValue(t *testing.T) {
var tristate triStateValue
f := setUpFlagSet(&tristate)
+ var buf bytes.Buffer
+ f.SetOutput(&buf)
err := f.Parse([]string{"--tristate=invalid"})
if err == nil {
t.Fatal("expected an error but did not get any, tristate has value", tristate)