Fix tests after upgrading hcl

This commit is contained in:
Radek Simko 2018-11-24 20:46:49 +00:00
parent 4f2868a019
commit 501fcd1e21
No known key found for this signature in database
GPG Key ID: 1F1C84FE689A88D7
2 changed files with 3 additions and 3 deletions

View File

@ -148,11 +148,11 @@ func TestOutputWithoutValueShouldFail(t *testing.T) {
if code != 1 { if code != 1 {
t.Fatalf("Should have failed: %d\n\n%s", code, ui.ErrorWriter.String()) t.Fatalf("Should have failed: %d\n\n%s", code, ui.ErrorWriter.String())
} }
wantError := `The attribute "value" is required, but no definition was found.` wantError := `The argument "value" is required, but no definition was found.`
if !strings.Contains(ui.ErrorWriter.String(), wantError) { if !strings.Contains(ui.ErrorWriter.String(), wantError) {
t.Fatalf("Missing error string %q\n\n'%s'", wantError, ui.ErrorWriter.String()) t.Fatalf("Missing error string %q\n\n'%s'", wantError, ui.ErrorWriter.String())
} }
wantError = `An attribute named "values" is not expected here. Did you mean "value"?` wantError = `An argument named "values" is not expected here. Did you mean "value"?`
if !strings.Contains(ui.ErrorWriter.String(), wantError) { if !strings.Contains(ui.ErrorWriter.String(), wantError) {
t.Fatalf("Missing error string %q\n\n'%s'", wantError, ui.ErrorWriter.String()) t.Fatalf("Missing error string %q\n\n'%s'", wantError, ui.ErrorWriter.String())
} }

View File

@ -102,7 +102,7 @@ func TestParserLoadConfigFileFailureMessages(t *testing.T) {
{ {
"invalid-files/unexpected-attr.tf", "invalid-files/unexpected-attr.tf",
hcl.DiagError, hcl.DiagError,
"Unsupported attribute", "Unsupported argument",
}, },
{ {
"invalid-files/unexpected-block.tf", "invalid-files/unexpected-block.tf",