diff options
| -rw-r--r-- | .travis.yml | 1 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | bool_test.go | 10 | ||||
| -rw-r--r-- | flag_test.go | 4 |
4 files changed, 9 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4f2ee4d --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: go @@ -1,3 +1,5 @@ +[](https://travis-ci.org/ogier/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 2073590..a2e1c5d 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 f552a2f..7d114b2 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 ( |
