Skip to content

Commit

Permalink
mark more internal funcs as helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
gulducat authored and shoenig committed Jun 15, 2024
1 parent 08f5431 commit f903659
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ type T interface {
}

func errorf(t T, msg string, args ...any) {
t.Helper()
t.Errorf(msg, args...)
}
2 changes: 2 additions & 0 deletions invocations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ func passing(result string) bool {
}

func fail(t T, msg string, scripts ...PostScript) {
t.Helper()
c := assertions.Caller()
s := c + msg + "\n" + run(scripts...)
errorf(t, "\n"+strings.TrimSpace(s)+"\n")
}

func invoke(t T, result string, settings ...Setting) {
t.Helper()
result = strings.TrimSpace(result)
if !passing(result) {
fail(t, result, scripts(settings...)...)
Expand Down
1 change: 1 addition & 0 deletions must/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ type T interface {
}

func errorf(t T, msg string, args ...any) {
t.Helper()
t.Fatalf(msg, args...)
}
2 changes: 2 additions & 0 deletions must/invocations.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f903659

Please sign in to comment.