From e2e6bce4c4c6bed6656d820727cb8ad548c03cfb Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Fri, 19 Mar 2021 13:56:41 +0100 Subject: [PATCH] Update hcl2_upgrade_test.go show diffs with strings --- command/hcl2_upgrade_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command/hcl2_upgrade_test.go b/command/hcl2_upgrade_test.go index 1e3ce491f..17c99a166 100644 --- a/command/hcl2_upgrade_test.go +++ b/command/hcl2_upgrade_test.go @@ -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)