Skip to content

Commit

Permalink
rename AssertEqualJSONs to AssertEqualJQ
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 19, 2024
1 parent 65ce6b6 commit 627cce6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/testcli/golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libs/testdiff/testdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 627cce6

Please sign in to comment.