Skip to content

Commit

Permalink
internal/assert: Fatalf -> Errorf
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Jul 24, 2024
1 parent 680d14d commit c30dc20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/assert/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ func Must(err error) {
func Error(t *testing.T, err error) {
t.Helper()
if err == nil {
t.Fatalf("got: %v, want: !nil", err)
t.Errorf("got: %v, want: !nil", err)
}
}

func NoError(t *testing.T, err error) {
t.Helper()
if err != nil {
t.Fatalf("got: %v, want: nil", err)
t.Errorf("got: %v, want: nil", err)
}
}

func Equal[T comparable](t *testing.T, got, want T) {
t.Helper()
if got != want {
t.Fatalf("got: %v, want: %v", got, want)
t.Errorf("got: %v, want: %v", got, want)
}
}

func True(t *testing.T, got bool) {
t.Helper()
if got {
t.Fatalf("got: %v, want: false", got)
t.Errorf("got: %v, want: false", got)
}
}

0 comments on commit c30dc20

Please sign in to comment.