unit

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(fixture interface{}, t *testing.T)

Types

type Fixture

type Fixture struct {
	// contains filtered or unexported fields
}

func (*Fixture) Assert

func (this *Fixture) Assert(condition bool, messages ...string) bool

Assert tests a boolean which, if not true, marks the current test case as failed and prints the provided message.

func (*Fixture) AssertDeepEqual

func (this *Fixture) AssertDeepEqual(expected, actual interface{}) bool

func (*Fixture) AssertEqual

func (this *Fixture) AssertEqual(expected, actual interface{}) bool

func (*Fixture) AssertSprintEqual

func (this *Fixture) AssertSprintEqual(expected, actual interface{}) bool

func (*Fixture) AssertSprintfEqual

func (this *Fixture) AssertSprintfEqual(expected, actual interface{}, format string) bool

func (*Fixture) Error

func (this *Fixture) Error(args ...interface{})

func (*Fixture) Errorf

func (this *Fixture) Errorf(f string, args ...interface{})

func (*Fixture) Failed

func (this *Fixture) Failed() bool

func (*Fixture) Finalize

func (this *Fixture) Finalize()

func (*Fixture) Name

func (this *Fixture) Name() string

func (*Fixture) Print

func (this *Fixture) Print(a ...interface{})

func (*Fixture) Printf

func (this *Fixture) Printf(format string, a ...interface{})

func (*Fixture) Println

func (this *Fixture) Println(a ...interface{})

func (*Fixture) So

func (this *Fixture) So(actual interface{}, assert assertion, expected ...interface{}) bool

func (*Fixture) Write

func (this *Fixture) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL