From 26f59b2f667494fabc0e64ebaac1fbb10089e702 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 8 Jan 2024 13:51:52 +0100 Subject: [PATCH] cli/compose/loader: use golden.Assert() for readability golden.AssertBytes prints the failure as a bytes-array, which makes it not human-readable; let's compare strings instead. Signed-off-by: Sebastiaan van Stijn --- cli/compose/loader/types_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/compose/loader/types_test.go b/cli/compose/loader/types_test.go index 805e1f4dc96e..a6498a8f2f2a 100644 --- a/cli/compose/loader/types_test.go +++ b/cli/compose/loader/types_test.go @@ -17,7 +17,7 @@ func TestMarshallConfig(t *testing.T) { actual, err := yaml.Marshal(cfg) assert.NilError(t, err) - golden.AssertBytes(t, actual, "full-example.yaml.golden") + golden.Assert(t, string(actual), "full-example.yaml.golden") // Make sure the expected can be parsed. yamlData, err := os.ReadFile("testdata/full-example.yaml.golden") @@ -34,7 +34,7 @@ func TestJSONMarshallConfig(t *testing.T) { cfg := fullExampleConfig(workingDir, homeDir) actual, err := json.MarshalIndent(cfg, "", " ") assert.NilError(t, err) - golden.AssertBytes(t, actual, "full-example.json.golden") + golden.Assert(t, string(actual), "full-example.json.golden") jsonData, err := os.ReadFile("testdata/full-example.json.golden") assert.NilError(t, err)