Add one more test

This commit is contained in:
Illia Volochii 2018-04-26 21:39:41 +03:00
parent 75bf1a1525
commit 488fd7e82a
1 changed files with 9 additions and 0 deletions

View File

@ -616,6 +616,15 @@ func TestEnvironmentVariableSliceArgumentBool(t *testing.T) {
assert.Equal(t, []bool{true, false, false, true}, args.Foo)
}
func TestEnvironmentVariableSliceArgumentError(t *testing.T) {
var args struct {
Foo []int `arg:"env"`
}
setenv(t, "FOO", "[1, 99]")
err := Parse(&args)
assert.Error(t, err)
}
type textUnmarshaler struct {
val int
}