Skip to content

Commit

Permalink
Mark VerifyNone as a test Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
tallclair committed Aug 17, 2022
1 parent fe3486f commit e1464d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions leaks.go
Expand Up @@ -29,6 +29,7 @@ import (
// TestingT is the minimal subset of testing.TB that we use.
type TestingT interface {
Error(...interface{})
Helper()
}

// filterStacks will filter any stacks excluded by the given opts.
Expand Down Expand Up @@ -74,6 +75,7 @@ func Find(options ...Option) error {
// tests by doing:
// defer VerifyNone(t)
func VerifyNone(t TestingT, options ...Option) {
t.Helper()
if err := Find(options...); err != nil {
t.Error(err)
}
Expand Down
2 changes: 2 additions & 0 deletions leaks_test.go
Expand Up @@ -73,6 +73,8 @@ func (ft *fakeT) Error(args ...interface{}) {
ft.errors = append(ft.errors, fmt.Sprint(args...))
}

func (*fakeT) Helper() {}

func TestVerifyNone(t *testing.T) {
ft := &fakeT{}
VerifyNone(ft)
Expand Down

0 comments on commit e1464d1

Please sign in to comment.