diff options
| author | Alex Flint <[email protected]> | 2016-01-23 18:35:08 -0800 |
|---|---|---|
| committer | Alex Flint <[email protected]> | 2016-01-23 18:35:08 -0800 |
| commit | 64a4bab5506099047596a99d4a9b71de8d69798e (patch) | |
| tree | c6063caf15b19da4c969a10f0d1261a81d2bbfd1 /parse_test.go | |
| parent | ed2b19f2bbf787a888bf02eb707a17f4878f4109 (diff) | |
add test for invalid durations
Diffstat (limited to 'parse_test.go')
| -rw-r--r-- | parse_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/parse_test.go b/parse_test.go index 5e9baf2..c30809d 100644 --- a/parse_test.go +++ b/parse_test.go @@ -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"` |
