diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..c4d88e37 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +sudo: false + +language: go + +go: + - 1.3 + - 1.4 + - tip diff --git a/README.md b/README.md index 4eef10b7..f7d63500 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) + ## Description pflag is a drop-in replacement for Go's flag package, implementing diff --git a/bool_test.go b/bool_test.go index 20735907..a2e1c5dc 100644 --- a/bool_test.go +++ b/bool_test.go @@ -2,14 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package pflag_test +package pflag import ( + "bytes" "fmt" "strconv" "testing" - - . "github.com/spf13/pflag" ) // This value can be a boolean ("true", "false") or "maybe" @@ -156,8 +155,9 @@ func TestImplicitFalse(t *testing.T) { func TestInvalidValue(t *testing.T) { var tristate triStateValue f := setUpFlagSet(&tristate) - args := []string{"--tristate=invalid"} - _, err := parseReturnStderr(t, f, args) + 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) } diff --git a/flag_test.go b/flag_test.go index f552a2f5..7d114b22 100644 --- a/flag_test.go +++ b/flag_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package pflag_test +package pflag import ( "bytes" @@ -14,8 +14,6 @@ import ( "strings" "testing" "time" - - . "github.com/spf13/pflag" ) var (