Skip to content

Commit ae47d9c

Browse files
authored
Merge pull request #68 from cdr/assert-comment-fixes
Fix function comments in assert package
2 parents 982b120 + 1acb21f commit ae47d9c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sloggers/slogtest/assert/assert.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package assert is a helper package for test assertions.
2-
package assert
2+
package assert // import "cdr.dev/slog/sloggers/slogtest/assert"
33

44
import (
55
"testing"
@@ -11,8 +11,8 @@ import (
1111

1212
// Equal asserts exp == act.
1313
//
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.
1616
func Equal(t testing.TB, exp, act interface{}, name string) {
1717
slog.Helper()
1818
if diff := assert.CmpDiff(exp, act); diff != "" {
@@ -24,6 +24,8 @@ func Equal(t testing.TB, exp, act interface{}, name string) {
2424
}
2525

2626
// Success asserts err == nil.
27+
//
28+
// If err isn't nil, it will fatal the test with the error.
2729
func Success(t testing.TB, err error, name string) {
2830
slog.Helper()
2931
if err != nil {
@@ -34,7 +36,9 @@ func Success(t testing.TB, err error, name string) {
3436
}
3537
}
3638

37-
// True act == true.
39+
// True asserts act == true.
40+
//
41+
// If act isn't true, it will fatal the test.
3842
func True(t testing.TB, act bool, name string) {
3943
slog.Helper()
4044
Equal(t, true, act, name)

0 commit comments

Comments
 (0)