Browse Source

add test for invalid durations

Alex Flint 10 years ago
parent
commit
64a4bab550
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      parse_test.go

+ 8
- 0
parse_test.go View File

@ -63,6 +63,14 @@ func TestDuration(t *testing.T) {
assert.Equal(t, 3*time.Millisecond, args.Foo)
}
func TestInvalidDuration(t *testing.T) {
var args struct {
Foo time.Duration
}
err := parse("--foo xxx", &args)
require.Error(t, err)
}
func TestMixed(t *testing.T) {
var args struct {
Foo string `arg:"-f"`


Loading…
Cancel
Save