Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions be.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package be

import (
"reflect"
"slices"
"testing"
)

Expand All @@ -24,15 +25,8 @@ func Unequal[T comparable](t testing.TB, bad, got T) {
// AllEqual calls t.Fatalf if want != got.
func AllEqual[T comparable](t testing.TB, want, got []T) {
t.Helper()
if len(want) != len(got) {
if !slices.Equal(want, got) {
t.Fatalf("want: %v; got: %v", want, got)
return
}
for i := range want {
if want[i] != got[i] {
t.Fatalf("want: %v; got: %v", want, got)
return
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func ErrorIs(t testing.TB, want, got error) {
}
}

// ErrorIs calls t.Fatalf if got cannot be assigned to want by [errors.As].
// ErrorAs calls t.Fatalf if got cannot be assigned to want by [errors.As].
func ErrorAs[T error](t testing.TB, want *T, got error) {
t.Helper()
if !errors.As(got, want) {
Expand Down