assert

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assert

type Assert func(bool, ...interface{})

Assert is a helper for tests

func New

func New(t T) Assert

New returns a new Assert

func (Assert) Contains

func (a Assert) Contains(expected, list interface{}, msg ...interface{})

Contains asserts the expected value is in the given list

func (Assert) Eq

func (a Assert) Eq(expected, actual interface{}, msg ...interface{})

Eq asserts the given values match

func (Assert) Error

func (a Assert) Error(actual error, msg ...interface{})

Error asserts the given error is not nil

func (Assert) False

func (a Assert) False(actual bool, msg ...interface{})

False sserts the given value is false

func (Assert) Ne

func (a Assert) Ne(expected, actual interface{}, msg ...interface{})

Ne asserts the given values don't match

func (Assert) Nil

func (a Assert) Nil(actual interface{}, msg ...interface{})

Nil asserts the given value is nil

func (Assert) NoError

func (a Assert) NoError(actual error, msg ...interface{})

NoError asserts the given error is not nil

func (Assert) NotNil

func (a Assert) NotNil(actual interface{}, msg ...interface{})

NotNil sserts the given value is not nil

func (Assert) SameElements

func (a Assert) SameElements(expected, actual interface{}, msg ...interface{})

SameElements asserts the values have the same elements. It ignores the order of the elements

func (Assert) True

func (a Assert) True(actual bool, msg ...interface{})

True asserts the given value is true

type T added in v0.0.3

type T interface {
	Error(...interface{})
	Helper()
}

T is an interface of what we use from testing.T

Jump to

Keyboard shortcuts

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