This commit is contained in:
a 2024-06-18 20:08:38 -05:00
parent b98c89fbb6
commit 01cb878087
No known key found for this signature in database
GPG key ID: 374BC539FE795AF0
4 changed files with 37 additions and 61 deletions

View file

@ -19,12 +19,13 @@ func AssertLoadError(t *testing.T, rawConfig string, configType string, expected
require.NoError(t, err)
err = tc.LaunchCaddy()
require.NoError(t, err)
defer tc.CleanupCaddy()
err = tc.LoadConfig(rawConfig, configType)
if !strings.Contains(err.Error(), expectedError) {
t.Errorf("expected error \"%s\" but got \"%s\"", expectedError, err.Error())
}
err = tc.CleanupCaddy()
require.NoError(t, err)
}
// CompareAdapt adapts a config and then compares it against an expected result