Documentation ¶
Overview ¶
package unit implements a light-weight x-Unit style testing framework. It is basically a scaled-down version of github.com/smartystreets/gunit. See https://smartystreets.com/blog/2018/07/lets-build-xunit-in-go for an explanation of the basic moving parts.
Index ¶
- func Run(fixture interface{}, t *testing.T)
- type Fixture
- func (this *Fixture) Assert(condition bool, messages ...string) bool
- func (this *Fixture) AssertDeepEqual(expected, actual interface{}) bool
- func (this *Fixture) AssertEqual(expected, actual interface{}) bool
- func (this *Fixture) AssertSprintEqual(expected, actual interface{}) bool
- func (this *Fixture) AssertSprintfEqual(expected, actual interface{}, format string) bool
- func (this *Fixture) Error(args ...interface{})
- func (this *Fixture) Errorf(f string, args ...interface{})
- func (this *Fixture) Failed() bool
- func (this *Fixture) Finalize()
- func (this *Fixture) Name() string
- func (this *Fixture) Print(a ...interface{})
- func (this *Fixture) Printf(format string, a ...interface{})
- func (this *Fixture) Println(a ...interface{})
- func (this *Fixture) So(actual interface{}, assert assertion, expected ...interface{}) bool
- func (this *Fixture) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
func (*Fixture) Assert ¶
Assert tests a boolean which, if not true, marks the current test case as failed and prints the provided message.
func (*Fixture) AssertDeepEqual ¶
func (*Fixture) AssertEqual ¶
func (*Fixture) AssertSprintEqual ¶
func (*Fixture) AssertSprintfEqual ¶
Click to show internal directories.
Click to hide internal directories.