assert

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package assert contains helpers for test assertions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmpDiff

func CmpDiff(exp, act interface{}) string

CmpDiff compares exp to act and returns a human readable string representing their diff. https://github.com/google/go-cmp/issues/40#issuecomment-328615283

func Equal

func Equal(t testing.TB, exp, act interface{}, name string)

Equal asserts exp == act.

func Error

func Error(t testing.TB, err error, name string)

Error asserts exp != nil.

func ErrorContains

func ErrorContains(t testing.TB, err error, sub, name string)

ErrorContains asserts the error string from err contains sub.

func False

func False(t testing.TB, act bool, name string)

False asserts false == act.

func Len

func Len(t testing.TB, n int, a interface{}, name string)

Len asserts n == len(a).

func Nil

func Nil(t testing.TB, v interface{}, name string)

Nil asserts v == nil.

func NotEqual

func NotEqual(t testing.TB, exp, act interface{}, name string)

NotEqual asserts exp != act.

func Success

func Success(t testing.TB, err error, name string)

Success asserts err == nil.

func True

func True(t testing.TB, act bool, name string)

True asserts true == act.

Types

This section is empty.

Jump to

Keyboard shortcuts

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