[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 {
|
||||
case "continue":
|
||||
*ea = ErrorActionContinue
|
||||
case "stop-job":
|
||||
case "", "stop-job":
|
||||
*ea = ErrorActionStopJob
|
||||
case "stop-action":
|
||||
*ea = ErrorActionStopAction
|
||||
|
|
|
@ -38,6 +38,16 @@ func TestErrorAction_UnmarshalYAML(t *testing.T) {
|
|||
input: []byte(`E: `),
|
||||
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",
|
||||
input: []byte(`foo: bar`),
|
||||
|
|
Loading…
Reference in a new issue