Skip to content

Commit 14c1cdb

Browse files
authored
chore: fix misc in testingz package (#132)
2 parents 5784c5b + 717644f commit 14c1cdb

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

testing/assert/assert.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@ import (
77
)
88

99
// NoError asserts that err is nil.
10-
func NoError(tb testing.TB, err error) bool {
10+
func NoError(tb testing.TB, err error) (success bool) {
1111
tb.Helper()
1212

1313
return internal.NoError(tb, tb.Errorf, err)
1414
}
1515

1616
// Error asserts that err is not nil.
17-
func Error(tb testing.TB, err error) bool {
17+
func Error(tb testing.TB, err error) (success bool) {
1818
tb.Helper()
1919

2020
return internal.Error(tb, tb.Errorf, err)
2121
}
2222

2323
// True asserts that value is true.
24-
func True(tb testing.TB, value bool) bool {
24+
func True(tb testing.TB, value bool) (success bool) {
2525
tb.Helper()
2626

2727
return internal.True(tb, tb.Errorf, value)
2828
}
2929

3030
// Equal asserts that expected and actual are deeply equal.
31-
func Equal(tb testing.TB, expected, actual interface{}) bool {
31+
func Equal(tb testing.TB, expected, actual interface{}) (success bool) {
3232
tb.Helper()
3333

3434
return internal.Equal(tb, tb.Errorf, expected, actual)
3535
}
3636

3737
// NotEqual asserts that expected and actual are not deeply equal.
38-
func NotEqual(tb testing.TB, expected, actual interface{}) bool {
38+
func NotEqual(tb testing.TB, expected, actual interface{}) (success bool) {
3939
tb.Helper()
4040

4141
return internal.NotEqual(tb, tb.Errorf, expected, actual)

testing/internal/common.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
stringz "github.com/kunitsucom/util.go/strings"
1111
)
1212

13-
func NoError(tb testing.TB, printf func(format string, args ...any), err error) bool {
13+
func NoError(tb testing.TB, printf func(format string, args ...any), err error) (success bool) {
1414
tb.Helper()
1515

1616
if err != nil {
@@ -20,7 +20,7 @@ func NoError(tb testing.TB, printf func(format string, args ...any), err error)
2020
return true
2121
}
2222

23-
func Error(tb testing.TB, printf func(format string, args ...any), err error) bool {
23+
func Error(tb testing.TB, printf func(format string, args ...any), err error) (success bool) {
2424
tb.Helper()
2525

2626
if err == nil {
@@ -30,7 +30,7 @@ func Error(tb testing.TB, printf func(format string, args ...any), err error) bo
3030
return true
3131
}
3232

33-
func ErrorsIs(tb testing.TB, printf func(format string, args ...any), err, target error) bool {
33+
func ErrorsIs(tb testing.TB, printf func(format string, args ...any), err, target error) (success bool) {
3434
tb.Helper()
3535

3636
if !errors.Is(err, target) {
@@ -43,7 +43,7 @@ func ErrorsIs(tb testing.TB, printf func(format string, args ...any), err, targe
4343
return true
4444
}
4545

46-
func True(tb testing.TB, printf func(format string, args ...any), value bool) bool {
46+
func True(tb testing.TB, printf func(format string, args ...any), value bool) (success bool) {
4747
tb.Helper()
4848

4949
if !value {
@@ -53,7 +53,7 @@ func True(tb testing.TB, printf func(format string, args ...any), value bool) bo
5353
return true
5454
}
5555

56-
func False(tb testing.TB, printf func(format string, args ...any), value bool) bool {
56+
func False(tb testing.TB, printf func(format string, args ...any), value bool) (success bool) {
5757
tb.Helper()
5858

5959
if value {
@@ -63,7 +63,7 @@ func False(tb testing.TB, printf func(format string, args ...any), value bool) b
6363
return true
6464
}
6565

66-
func Equal(tb testing.TB, printf func(format string, args ...any), expected, actual interface{}) bool {
66+
func Equal(tb testing.TB, printf func(format string, args ...any), expected, actual interface{}) (success bool) {
6767
tb.Helper()
6868

6969
if !reflect.DeepEqual(expected, actual) {
@@ -73,7 +73,7 @@ func Equal(tb testing.TB, printf func(format string, args ...any), expected, act
7373
return true
7474
}
7575

76-
func NotEqual(tb testing.TB, printf func(format string, args ...any), expected, actual interface{}) bool {
76+
func NotEqual(tb testing.TB, printf func(format string, args ...any), expected, actual interface{}) (success bool) {
7777
tb.Helper()
7878

7979
if reflect.DeepEqual(expected, actual) {

testing/require/require.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@ import (
77
)
88

99
// NoError asserts that err is nil.
10-
func NoError(tb testing.TB, err error) bool {
10+
func NoError(tb testing.TB, err error) (success bool) {
1111
tb.Helper()
1212

1313
return internal.NoError(tb, tb.Fatalf, err)
1414
}
1515

1616
// Error asserts that err is not nil.
17-
func Error(tb testing.TB, err error) bool {
17+
func Error(tb testing.TB, err error) (success bool) {
1818
tb.Helper()
1919

2020
return internal.Error(tb, tb.Fatalf, err)
2121
}
2222

2323
// True asserts that value is true.
24-
func True(tb testing.TB, value bool) bool {
24+
func True(tb testing.TB, value bool) (success bool) {
2525
tb.Helper()
2626

2727
return internal.True(tb, tb.Fatalf, value)
2828
}
2929

3030
// Equal asserts that expected and actual are deeply equal.
31-
func Equal(tb testing.TB, expected, actual interface{}) bool {
31+
func Equal(tb testing.TB, expected, actual interface{}) (success bool) {
3232
tb.Helper()
3333

3434
return internal.Equal(tb, tb.Fatalf, expected, actual)
3535
}
3636

3737
// NotEqual asserts that expected and actual are not deeply equal.
38-
func NotEqual(tb testing.TB, expected, actual interface{}) bool {
38+
func NotEqual(tb testing.TB, expected, actual interface{}) (success bool) {
3939
tb.Helper()
4040

4141
return internal.NotEqual(tb, tb.Fatalf, expected, actual)

0 commit comments

Comments
 (0)