Skip to content

Commit

Permalink
zaptest: Expand TestingT interface
Browse files Browse the repository at this point in the history
This expands the TestingT interface to a much larger subset of
`testing.TB`.

The following were left out:

- `Error` and `Log` were left out in favor of `Errorf` and `Logf`
- `Fatal*` methods were left out in favor of `Errorf` followed by
  `FailNow`
- `Skip*` methods were left out because our test logger shouldn't be
  skipping tests
- `Helper` was left out because not all supported verisons of Go have
  that
  • Loading branch information
abhinav authored and akshayjshah committed Apr 12, 2018
1 parent 7f23cf1 commit d4d2796
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zaptest/testingt.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ type TestingT interface {
// Logs the given message and marks the test as failed.
Errorf(string, ...interface{})

// Marks the test as failed.
Fail()

// Returns true if the test has been marked as failed.
Failed() bool

// Returns the name of the test.
Name() string

// Marks the test as failed and stops execution of that test.
FailNow()
}
Expand Down

0 comments on commit d4d2796

Please sign in to comment.