check return value from `unmarshalRoot` in test and fail if false
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
2fe6d306aa
commit
f58eeef49d
|
|
@ -99,7 +99,10 @@ func TestEnvInConfig(t *testing.T) {
|
||||||
t.Errorf("Error loading YAML: %v", err)
|
t.Errorf("Error loading YAML: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
unmarshalRoot(k, cfg)
|
if !unmarshalRoot(k, cfg) {
|
||||||
|
t.Errorf("Error unmarshalling config for env=%q", tt.input)
|
||||||
|
continue
|
||||||
|
}
|
||||||
field := tt.selector(cfg)
|
field := tt.selector(cfg)
|
||||||
assert.Equal(t, tt.output, field,
|
assert.Equal(t, tt.output, field,
|
||||||
"Unmarshaled config field doesn't match expected value: env=%q", tt.input)
|
"Unmarshaled config field doesn't match expected value: env=%q", tt.input)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue