switch to testutil.TestingT interface

I've also considered https://pkg.go.dev/github.com/stretchr/testify/require#TestingT to avoid
dependency on /internal/ but that one does not have Logf method that I use
This commit is contained in:
Denis Bilenko 2024-12-20 13:38:45 +01:00
parent f6e8f268e2
commit 8945ee34e9
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package testdiff
import (
"fmt"
"strings"
"testing"
"github.com/databricks/cli/internal/testutil"
"github.com/hexops/gotextdiff"
@ -29,7 +28,7 @@ func AssertEqualTexts(t testutil.TestingT, filename1, filename2, expected, out s
}
}
func AssertEqualJQ(t *testing.T, expectedName, outName, expected, out string, ignorePaths []string) {
func AssertEqualJQ(t testutil.TestingT, 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)