1
1
// Package assert is a helper package for test assertions.
2
- package assert
2
+ package assert // import "cdr.dev/slog/sloggers/slogtest/assert"
3
3
4
4
import (
5
5
"testing"
@@ -11,8 +11,8 @@ import (
11
11
12
12
// Equal asserts exp == act.
13
13
//
14
- // If they are not equal, it will fatal the test
15
- // with a diff of the differences .
14
+ // If they are not equal, it will fatal the test with a diff of the
15
+ // two objects .
16
16
func Equal (t testing.TB , exp , act interface {}, name string ) {
17
17
slog .Helper ()
18
18
if diff := assert .CmpDiff (exp , act ); diff != "" {
@@ -24,6 +24,8 @@ func Equal(t testing.TB, exp, act interface{}, name string) {
24
24
}
25
25
26
26
// Success asserts err == nil.
27
+ //
28
+ // If err isn't nil, it will fatal the test with the error.
27
29
func Success (t testing.TB , err error , name string ) {
28
30
slog .Helper ()
29
31
if err != nil {
@@ -34,7 +36,9 @@ func Success(t testing.TB, err error, name string) {
34
36
}
35
37
}
36
38
37
- // True act == true.
39
+ // True asserts act == true.
40
+ //
41
+ // If act isn't true, it will fatal the test.
38
42
func True (t testing.TB , act bool , name string ) {
39
43
slog .Helper ()
40
44
Equal (t , true , act , name )
0 commit comments