Update hcl2_upgrade_test.go

show diffs with strings
This commit is contained in:
Adrien Delorme 2021-03-19 13:56:41 +01:00
parent 502708b86a
commit e2e6bce4c4
1 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,7 @@ func Test_hcl2_upgrade(t *testing.T) {
{folder: "variables-only", flags: []string{}},
{folder: "variables-with-variables", flags: []string{}},
{folder: "complete-variables-with-template-engine", flags: []string{}},
{folder: "escaped", flags: []string{}},
}
for _, tc := range tc {
@ -46,8 +47,8 @@ func Test_hcl2_upgrade(t *testing.T) {
if err != nil {
t.Fatalf("%v %s", err, bs)
}
expected := mustBytes(ioutil.ReadFile(expectedPath))
actual := mustBytes(ioutil.ReadFile(outputPath))
expected := string(mustBytes(ioutil.ReadFile(expectedPath)))
actual := string(mustBytes(ioutil.ReadFile(outputPath)))
if diff := cmp.Diff(expected, actual); diff != "" {
t.Fatalf("unexpected output: %s", diff)