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 ...any)
- func (t *T) Errorf(format string, vs ...any)
- func (t *T) Fail()
- func (t *T) FailNow()
- func (t *T) Failed() bool
- func (t *T) Fatal(vs ...any)
- func (t *T) Fatalf(format string, vs ...any)
- func (t *T) Helper()
- func (t *T) Log(vs ...any)
- func (t *T) Logf(format string, vs ...any)
- 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).
Click to show internal directories.
Click to hide internal directories.