Return immediately from test if error is encountered

This commit is contained in:
Ray Miller 2023-05-10 17:04:02 +01:00
parent d12dfef527
commit 66695a0474

View file

@ -77,6 +77,7 @@ func TestParseConfig(t *testing.T) {
} else { } else {
if err != nil { if err != nil {
t.Errorf("got unexpected error: %v", err) t.Errorf("got unexpected error: %v", err)
return
} }
if res.versionPrefix != tc.expect.versionPrefix { if res.versionPrefix != tc.expect.versionPrefix {
t.Errorf("got versionPrefix %s, expected %s", res.versionPrefix, tc.expect.versionPrefix) t.Errorf("got versionPrefix %s, expected %s", res.versionPrefix, tc.expect.versionPrefix)