aboutsummaryrefslogtreecommitdiff
path: root/bool_test.go
diff options
context:
space:
mode:
authorAlex Ogier <[email protected]>2015-02-14 18:01:23 -0500
committerAlex Ogier <[email protected]>2015-02-14 18:01:23 -0500
commit6cc5761fd2011fd5c47845dd9950dfa8405daae1 (patch)
tree1ad58c7f366b213852a8eb59f533d254595a5eaa /bool_test.go
parented64959555548bf06c8f40878c7579ecd4a8ca68 (diff)
Fixed noisy test case for the new boolFlag
Diffstat (limited to 'bool_test.go')
-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)