[wip] error-action: added missing case for empty string
This commit is contained in:
parent
b21b352923
commit
f0feb88d5a
|
@ -30,7 +30,7 @@ func (ea *ErrorAction) UnmarshalYAML(value *yaml.Node) error {
|
||||||
switch lowered {
|
switch lowered {
|
||||||
case "continue":
|
case "continue":
|
||||||
*ea = ErrorActionContinue
|
*ea = ErrorActionContinue
|
||||||
case "stop-job":
|
case "", "stop-job":
|
||||||
*ea = ErrorActionStopJob
|
*ea = ErrorActionStopJob
|
||||||
case "stop-action":
|
case "stop-action":
|
||||||
*ea = ErrorActionStopAction
|
*ea = ErrorActionStopAction
|
||||||
|
|
|
@ -38,6 +38,16 @@ func TestErrorAction_UnmarshalYAML(t *testing.T) {
|
||||||
input: []byte(`E: `),
|
input: []byte(`E: `),
|
||||||
want: ErrorActionStopJob,
|
want: ErrorActionStopJob,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "whitespace only is stop-job",
|
||||||
|
input: []byte(`E: " "`),
|
||||||
|
want: ErrorActionStopJob,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "empty is stop-job",
|
||||||
|
input: []byte(`E: ""`),
|
||||||
|
want: ErrorActionStopJob,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "unset is stop-job 2",
|
name: "unset is stop-job 2",
|
||||||
input: []byte(`foo: bar`),
|
input: []byte(`foo: bar`),
|
||||||
|
|
Loading…
Reference in a new issue