summaryrefslogtreecommitdiff
path: root/parse_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'parse_test.go')
-rw-r--r--parse_test.go8
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"`