assert

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(msg string, args ...interface{})

Fail the current test case with given message

func RegisterT

func RegisterT(t *testing.T)

RegisterT saves current testing.T for further usage by Expect

Types

type AnyAssertions

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

AnyAssertions is used to assert any kind of value

func Expect

func Expect(actual interface{}) *AnyAssertions

Expect starts new assertions on given value

func (*AnyAssertions) ContainsSubstring

func (a *AnyAssertions) ContainsSubstring(substr string) bool

ContainsSubstring asserts that actual value contains given substring

func (*AnyAssertions) Equals

func (a *AnyAssertions) Equals(expected interface{}) bool

Equals asserts that actual value equals expected value

func (*AnyAssertions) EventuallyEquals

func (a *AnyAssertions) EventuallyEquals(expected interface{}) bool

EventuallyEquals asserts that, withtin 5 seconds, the actual function will return same value as expected value

func (*AnyAssertions) HasLen

func (a *AnyAssertions) HasLen(expected int) bool

HasLen asserts that actual value has an expected length

func (*AnyAssertions) IsEmpty

func (a *AnyAssertions) IsEmpty() bool

IsEmpty asserts that actual value is empty

func (*AnyAssertions) IsFalse

func (a *AnyAssertions) IsFalse() bool

IsFalse asserts that actual value is false

func (*AnyAssertions) IsNil

func (a *AnyAssertions) IsNil() bool

IsNil asserts that actual value is nil

func (*AnyAssertions) IsNotEmpty

func (a *AnyAssertions) IsNotEmpty() bool

IsNotEmpty asserts that actual value is not empty

func (*AnyAssertions) IsNotNil

func (a *AnyAssertions) IsNotNil() bool

IsNotNil asserts that actual value is not nil

func (*AnyAssertions) IsTrue

func (a *AnyAssertions) IsTrue() bool

IsTrue asserts that actual value is true

func (*AnyAssertions) NotEquals

func (a *AnyAssertions) NotEquals(other interface{}) bool

NotEquals asserts that actual value is different than given value

func (*AnyAssertions) Panics

func (a *AnyAssertions) Panics() (panicked bool)

Panics asserts that actual value panics whenever called

func (*AnyAssertions) TemporarilySimilar

func (a *AnyAssertions) TemporarilySimilar(other time.Time, diff time.Duration) bool

TemporarilySimilar asserts that actual value is between a range of other time value

Jump to

Keyboard shortcuts

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