Skip to content

Commit

Permalink
assertEqual: switch to testing.TB
Browse files Browse the repository at this point in the history
  • Loading branch information
myaaaaaaaaa committed Dec 17, 2024
1 parent 6bf919c commit 44f4048
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions gojqx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ func BenchmarkShuffle(b *testing.B) {
`)

ss := slices.Collect(query(b.N))
if len(ss) != 1 {
panic(len(ss))
}
assertEqual(b, len(ss), 1)

buckets := ss[0].(map[string]any)
for k, v := range buckets {
Expand Down
8 changes: 4 additions & 4 deletions util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"testing"
)

func assertEqual[T comparable](t *testing.T, got T, want T) {
t.Helper()
func assertEqual[T comparable](tb testing.TB, got T, want T) {
tb.Helper()
if got != want {
t.Error("got", got)
t.Error("want", want)
tb.Error("got", got)
tb.Error("want", want)
}
}
func assertString(t *testing.T, got any, want string) {
Expand Down

0 comments on commit 44f4048

Please sign in to comment.