test

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPanic

func CheckPanic(t *testing.T, fn func(), contains string) bool

CheckPanic checks that fn() panics and that the panic() arg is a string that contains contains.

func EqualBool

func EqualBool(t *testing.T, got, expected bool, args ...interface{}) bool

EqualBool checks that got equals expected.

func EqualErrorMessage

func EqualErrorMessage(t *testing.T, got, expected interface{},
	args ...interface{})

EqualErrorMessage prints a test error message of the form:

Message
Failed test
       got: got_value
  expected: expected_value

func EqualInt

func EqualInt(t *testing.T, got, expected int, args ...interface{}) bool

EqualInt checks that got equals expected.

func EqualStr

func EqualStr(t *testing.T, got, expected string, args ...interface{}) bool

EqualStr checks that got equals expected.

func IsFalse

func IsFalse(t *testing.T, got bool, args ...interface{}) bool

IsFalse checks that got is false.

func IsTrue

func IsTrue(t *testing.T, got bool, args ...interface{}) bool

IsTrue checks that got is true.

Types

type TestingFT

type TestingFT struct {
	TestingT
	// contains filtered or unexported fields
}

TestingFT is a type implementing td.TestingFT intended to be used in tests.

func NewTestingFT added in v1.2.0

func NewTestingFT(name string) *TestingFT

NewTestingFT returns a new instance of *TestingFT.

func (*TestingFT) Errorf

func (t *TestingFT) Errorf(format string, args ...interface{})

Errorf mocks testing.T Errorf method.

func (*TestingFT) Fail

func (t *TestingFT) Fail()

Fail mocks testing.T Fail method.

func (*TestingFT) FailNow

func (t *TestingFT) FailNow()

FailNow mocks testing.T FailNow method.

func (*TestingFT) Failed

func (t *TestingFT) Failed() bool

Failed mocks testing.T Failed method.

func (*TestingFT) Fatalf

func (t *TestingFT) Fatalf(format string, args ...interface{})

Fatalf mocks testing.T Fatalf method.

func (*TestingFT) Log

func (t *TestingFT) Log(args ...interface{})

Log mocks testing.T Log method.

func (*TestingFT) Logf

func (t *TestingFT) Logf(format string, args ...interface{})

Logf mocks testing.T Logf method.

func (*TestingFT) Name

func (t *TestingFT) Name() string

Name mocks testing.T Name method.

func (*TestingFT) Run

func (t *TestingFT) Run(name string, f func(t *testing.T)) bool

Run mocks testing.T Run method.

func (*TestingFT) Skip

func (t *TestingFT) Skip(args ...interface{})

Skip mocks testing.T Skip method.

func (*TestingFT) SkipNow

func (t *TestingFT) SkipNow()

SkipNow mocks testing.T SkipNow method.

func (*TestingFT) Skipf

func (t *TestingFT) Skipf(format string, args ...interface{})

Skipf mocks testing.T Skipf method.

func (*TestingFT) Skipped

func (t *TestingFT) Skipped() bool

Skipped mocks testing.T Skipped method.

type TestingT

type TestingT struct {
	LastMessage string
	IsFatal     bool
	HasFailed   bool
}

TestingT is a type implementing td.TestingT intended to be used in tests.

func NewTestingT added in v1.2.0

func NewTestingT() *TestingT

NewTestingT returns a new instance of *TestingT.

func (*TestingT) Error

func (t *TestingT) Error(args ...interface{})

Fatal mocks testing.T Error method.

func (*TestingT) Fatal

func (t *TestingT) Fatal(args ...interface{})

Fatal mocks testing.T Fatal method.

func (*TestingT) Helper

func (t *TestingT) Helper()

Helper mocks testing.T Helper method.

Jump to

Keyboard shortcuts

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