Documentation ¶
Overview ¶
Package utesting provides a standalone replacement for package testing.
This package exists because package testing cannot easily be embedded into a standalone go program. It provides an API that mirrors the standard library testing API.
Index ¶
- func CountFailures(rr []Result) int
- func Run(test Test) (bool, string)
- type Result
- type T
- func (t *T) Error(vs ...interface{})
- func (t *T) Errorf(format string, vs ...interface{})
- func (t *T) Fail()
- func (t *T) FailNow()
- func (t *T) Failed() bool
- func (t *T) Fatal(vs ...interface{})
- func (t *T) Fatalf(format string, vs ...interface{})
- func (t *T) Helper()
- func (t *T) Log(vs ...interface{})
- func (t *T) Logf(format string, vs ...interface{})
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountFailures ¶
CountFailures returns the number of failed tests in the result slice.
Types ¶
type Result ¶
Result is the result of a test execution.
type T ¶
type T struct {
// contains filtered or unexported fields
}
T is the value given to the test function. The test can signal failures and log output by calling methods on this object.
func (*T) FailNow ¶
func (t *T) FailNow()
FailNow marks the test as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine).
func (*T) Fatal ¶
func (t *T) Fatal(vs ...interface{})
Fatal is equivalent to Log followed by FailNow.
func (*T) Helper ¶ added in v1.5.0
func (t *T) Helper()
Helper exists for compatibility with testing.T.