Add one more test
This commit is contained in:
parent
75bf1a1525
commit
488fd7e82a
|
@ -616,6 +616,15 @@ func TestEnvironmentVariableSliceArgumentBool(t *testing.T) {
|
||||||
assert.Equal(t, []bool{true, false, false, true}, args.Foo)
|
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 {
|
type textUnmarshaler struct {
|
||||||
val int
|
val int
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue