diff options
| author | Eric Paris <[email protected]> | 2015-04-29 14:37:43 -0400 |
|---|---|---|
| committer | Eric Paris <[email protected]> | 2015-04-29 14:37:43 -0400 |
| commit | 9add834c39d2b9a7b85a5144e4d399f43abbd13d (patch) | |
| tree | 7baca5112bf1c051fd3d01a224e2681b89f722b4 | |
| parent | d4ebabf889f7b016ffcb5f74c350e1e5424b2094 (diff) | |
| parent | 2e6f5f3f0c40ab9cb459742296f6a2aaab1fd5dc (diff) | |
Merge remote-tracking branch 'ogier/master' into merge
Conflicts:
bool_test.go
flag.go
flag_test.go
| -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 ( |
