mirror of https://github.com/databricks/cli.git
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:
parent
f6e8f268e2
commit
8945ee34e9
|
@ -3,7 +3,6 @@ package testdiff
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/databricks/cli/internal/testutil"
|
"github.com/databricks/cli/internal/testutil"
|
||||||
"github.com/hexops/gotextdiff"
|
"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))
|
patch, err := jsondiff.CompareJSON([]byte(expected), []byte(out))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Logf("CompareJSON error for %s vs %s: %s (fallback to textual comparison)", outName, expectedName, err)
|
t.Logf("CompareJSON error for %s vs %s: %s (fallback to textual comparison)", outName, expectedName, err)
|
||||||
|
|
Loading…
Reference in New Issue