hcl2template: don't error if test wants diags

The required_plugins parse tests define a `want_diags' flag, but don't
actually use it in subtests, so if one was to add a test that is
expected to produce errors on this step, this would always fail.
This commit is contained in:
Lucas Bajolet
2023-09-28 11:23:11 -04:00
parent d56db70a57
commit 6d2dfb0679
+3 -1
View File
@@ -138,7 +138,9 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) {
if len(diags) > 0 {
t.Fatal(diags)
}
if diags := cfg.decodeRequiredPluginsBlock(file); len(diags) > 0 {
diags = cfg.decodeRequiredPluginsBlock(file)
if !tt.wantDiags && len(diags) > 0 {
t.Fatal(diags)
}