diff --git a/internal/testcli/golden.go b/internal/testcli/golden.go index c1e1345daa..6c1d14ad69 100644 --- a/internal/testcli/golden.go +++ b/internal/testcli/golden.go @@ -75,7 +75,7 @@ func RequireOutputJQ(t testutil.TestingT, ctx context.Context, args []string, ex if out != expected { actual := fmt.Sprintf("Output from %v", args) - testdiff.AssertEqualJSONs(t.(*testing.T), expectedFilename, actual, expected, out, ignorePaths) + testdiff.AssertEqualJQ(t.(*testing.T), expectedFilename, actual, expected, out, ignorePaths) if OverwriteMode { WriteFile(t, expectedPath, out) diff --git a/libs/testdiff/testdiff.go b/libs/testdiff/testdiff.go index 7a0077f096..fad12c7680 100644 --- a/libs/testdiff/testdiff.go +++ b/libs/testdiff/testdiff.go @@ -29,7 +29,7 @@ func AssertEqualTexts(t testutil.TestingT, filename1, filename2, expected, out s } } -func AssertEqualJSONs(t *testing.T, expectedName, outName, expected, out string, ignorePaths []string) { +func AssertEqualJQ(t *testing.T, expectedName, outName, expected, out string, ignorePaths []string) { patch, err := jsondiff.CompareJSON([]byte(expected), []byte(out)) if err != nil { t.Logf("CompareJSON error for %s vs %s: %s (fallback to textual comparison)", outName, expectedName, err)