assert

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(t testing.T,
	expectedElement interface{},
	container interface{},
	msg ...interface{}) bool

Contains tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The type of elements within `container` must match the type of `expectedElement`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsBool

func ContainsBool(t testing.T,
	expectedElement bool,
	container interface{},
	msg ...interface{}) bool

ContainsBool tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `bool`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsByte

func ContainsByte(t testing.T,
	expectedElement byte,
	container interface{},
	msg ...interface{}) bool

ContainsByte tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `byte`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsComplex128

func ContainsComplex128(t testing.T,
	expectedElement complex128,
	container interface{},
	msg ...interface{}) bool

ContainsComplex128 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `complex128`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsComplex64

func ContainsComplex64(t testing.T,
	expectedElement complex64,
	container interface{},
	msg ...interface{}) bool

ContainsComplex64 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `complex64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsError

func ContainsError(t testing.T,
	expectedElement error,
	container interface{},
	msg ...interface{}) bool

ContainsError tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `error`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsFloat32

func ContainsFloat32(t testing.T,
	expectedElement float32,
	container interface{},
	msg ...interface{}) bool

ContainsFloat32 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `float32`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsFloat64

func ContainsFloat64(t testing.T,
	expectedElement float64,
	container interface{},
	msg ...interface{}) bool

ContainsFloat64 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `float64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsInt

func ContainsInt(t testing.T,
	expectedElement int,
	container interface{},
	msg ...interface{}) bool

ContainsInt tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `int`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsInt16

func ContainsInt16(t testing.T,
	expectedElement int16,
	container interface{},
	msg ...interface{}) bool

ContainsInt16 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `int16`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsInt32

func ContainsInt32(t testing.T,
	expectedElement int32,
	container interface{},
	msg ...interface{}) bool

ContainsInt32 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `int32`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsInt64

func ContainsInt64(t testing.T,
	expectedElement int64,
	container interface{},
	msg ...interface{}) bool

ContainsInt64 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `int64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsInt8

func ContainsInt8(t testing.T,
	expectedElement int8,
	container interface{},
	msg ...interface{}) bool

ContainsInt8 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `int8`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsRune

func ContainsRune(t testing.T,
	expectedElement rune,
	container interface{},
	msg ...interface{}) bool

ContainsRune tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `rune`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsString

func ContainsString(t testing.T,
	expectedElement string,
	container interface{},
	msg ...interface{}) bool

ContainsString tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `string`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsUint

func ContainsUint(t testing.T,
	expectedElement uint,
	container interface{},
	msg ...interface{}) bool

ContainsUint tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `uint`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsUint16

func ContainsUint16(t testing.T,
	expectedElement uint16,
	container interface{},
	msg ...interface{}) bool

ContainsUint16 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `uint16`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsUint32

func ContainsUint32(t testing.T,
	expectedElement uint32,
	container interface{},
	msg ...interface{}) bool

ContainsUint32 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `uint32`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsUint64

func ContainsUint64(t testing.T,
	expectedElement uint64,
	container interface{},
	msg ...interface{}) bool

ContainsUint64 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `uint64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsUint8

func ContainsUint8(t testing.T,
	expectedElement uint8,
	container interface{},
	msg ...interface{}) bool

ContainsUint8 tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `uint8`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func ContainsUintptr

func ContainsUintptr(t testing.T,
	expectedElement uintptr,
	container interface{},
	msg ...interface{}) bool

ContainsUintptr tests if `expectedElement` is contained within `container`. `container` can be a string, map (only keys are matched), array or slice. The `container` must have elements of type `uintptr`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `Contains` for more static typing. See also `NotContains`.

func DeepEqual

func DeepEqual(t testing.T,
	left interface{},
	right interface{},
	msg ...interface{}) bool

DeepEqual tests if `left` == `right` using `reflect.DeepEqual`. msg is an optional list of arguments following the `fmt.Printf()` format. This is a deep, recursive equality test. See also `Equal`.

func Empty

func Empty(t testing.T, container interface{}, msg ...interface{}) bool

Empty tests if the passed value is Empty. A nil container or a container with zero elements are both empty. Uses Go len(). Container can be any of Array, Chan, Map, Slice, or String. msg is an optional list of arguments following the `fmt.Printf()` format. See also `Nil`.

func Equal

func Equal(t testing.T,
	left interface{},
	right interface{},
	msg ...interface{}) bool

Equal tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two interface{}. This is a strict equality test. It will fail if `left` and `right` have different types. For example, int32(42) is not equal to int64(42). You can use the typed versions of `Equal` for more static typing. Note that Slice, map, and function values are not comparable. See also `DeepEqual`.

func EqualBool

func EqualBool(t testing.T,
	left bool,
	right bool,
	msg ...interface{}) bool

EqualBool tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two bool.

func EqualByte

func EqualByte(t testing.T,
	left byte,
	right byte,
	msg ...interface{}) bool

EqualByte tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two byte.

func EqualComplex128

func EqualComplex128(t testing.T,
	left complex128,
	right complex128,
	msg ...interface{}) bool

EqualComplex128 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two complex128.

func EqualComplex64

func EqualComplex64(t testing.T,
	left complex64,
	right complex64,
	msg ...interface{}) bool

EqualComplex64 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two complex64.

func EqualError

func EqualError(t testing.T,
	left error,
	right error,
	msg ...interface{}) bool

EqualError tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two error.

func EqualFloat32

func EqualFloat32(t testing.T,
	left float32,
	right float32,
	msg ...interface{}) bool

EqualFloat32 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two float32.

func EqualFloat64

func EqualFloat64(t testing.T,
	left float64,
	right float64,
	msg ...interface{}) bool

EqualFloat64 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two float64.

func EqualInt

func EqualInt(t testing.T,
	left int,
	right int,
	msg ...interface{}) bool

EqualInt tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int.

func EqualInt16

func EqualInt16(t testing.T,
	left int16,
	right int16,
	msg ...interface{}) bool

EqualInt16 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int16.

func EqualInt32

func EqualInt32(t testing.T,
	left int32,
	right int32,
	msg ...interface{}) bool

EqualInt32 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int32.

func EqualInt64

func EqualInt64(t testing.T,
	left int64,
	right int64,
	msg ...interface{}) bool

EqualInt64 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int64.

func EqualInt8

func EqualInt8(t testing.T,
	left int8,
	right int8,
	msg ...interface{}) bool

EqualInt8 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int8.

func EqualRune

func EqualRune(t testing.T,
	left rune,
	right rune,
	msg ...interface{}) bool

EqualRune tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two rune.

func EqualString

func EqualString(t testing.T,
	left string,
	right string,
	msg ...interface{}) bool

EqualString tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two string.

func EqualTypes

func EqualTypes(t testing.T,
	left interface{},
	right interface{},
	msg ...interface{}) bool

EqualTypes tests if `left` and `right` have the same type. msg is an optional list of arguments following the `fmt.Printf()` format. Example:

var a int32 = 42;
EqualType(t, int32(0), a)

func EqualUint

func EqualUint(t testing.T,
	left uint,
	right uint,
	msg ...interface{}) bool

EqualUint tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint.

func EqualUint16

func EqualUint16(t testing.T,
	left uint16,
	right uint16,
	msg ...interface{}) bool

EqualUint16 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint16.

func EqualUint32

func EqualUint32(t testing.T,
	left uint32,
	right uint32,
	msg ...interface{}) bool

EqualUint32 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint32.

func EqualUint64

func EqualUint64(t testing.T,
	left uint64,
	right uint64,
	msg ...interface{}) bool

EqualUint64 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint64.

func EqualUint8

func EqualUint8(t testing.T,
	left uint8,
	right uint8,
	msg ...interface{}) bool

EqualUint8 tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint8.

func EqualUintptr

func EqualUintptr(t testing.T,
	left uintptr,
	right uintptr,
	msg ...interface{}) bool

EqualUintptr tests if `left` is equal to `right` using the `==` operator. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uintptr.

func Failed

func Failed(t testing.T, fmtstr string, args ...interface{})

Failed logs a message and fails the test. fmtstr and args follows the `fmt.Printf()` format.

func False

func False(t testing.T, tval bool, msg ...interface{}) bool

False tests if val is False. msg is an optional list of arguments following the `fmt.Printf()` format.

func Nil

func Nil(t testing.T, tval interface{}, msg ...interface{}) bool

Nil tests if the passed value is Nil. See also Empty. msg is an optional list of arguments following the `fmt.Printf()` format.

func NotContains

func NotContains(t testing.T,
	expectedElement interface{},
	container interface{},
	msg ...interface{}) bool

NotContains tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The type of elements within `container` must match the type of `expectedElement`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsBool

func NotContainsBool(t testing.T,
	expectedElement bool,
	container interface{},
	msg ...interface{}) bool

NotContainsBool tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `bool`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsByte

func NotContainsByte(t testing.T,
	expectedElement byte,
	container interface{},
	msg ...interface{}) bool

NotContainsByte tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `byte`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsComplex128

func NotContainsComplex128(t testing.T,
	expectedElement complex128,
	container interface{},
	msg ...interface{}) bool

NotContainsComplex128 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `complex128`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsComplex64

func NotContainsComplex64(t testing.T,
	expectedElement complex64,
	container interface{},
	msg ...interface{}) bool

NotContainsComplex64 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `complex64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsError

func NotContainsError(t testing.T,
	expectedElement error,
	container interface{},
	msg ...interface{}) bool

NotContainsError tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `error`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsFloat32

func NotContainsFloat32(t testing.T,
	expectedElement float32,
	container interface{},
	msg ...interface{}) bool

NotContainsFloat32 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `float32`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsFloat64

func NotContainsFloat64(t testing.T,
	expectedElement float64,
	container interface{},
	msg ...interface{}) bool

NotContainsFloat64 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `float64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsInt

func NotContainsInt(t testing.T,
	expectedElement int,
	container interface{},
	msg ...interface{}) bool

NotContainsInt tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `int`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsInt16

func NotContainsInt16(t testing.T,
	expectedElement int16,
	container interface{},
	msg ...interface{}) bool

NotContainsInt16 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `int16`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsInt32

func NotContainsInt32(t testing.T,
	expectedElement int32,
	container interface{},
	msg ...interface{}) bool

NotContainsInt32 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `int32`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsInt64

func NotContainsInt64(t testing.T,
	expectedElement int64,
	container interface{},
	msg ...interface{}) bool

NotContainsInt64 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `int64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsInt8

func NotContainsInt8(t testing.T,
	expectedElement int8,
	container interface{},
	msg ...interface{}) bool

NotContainsInt8 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `int8`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsRune

func NotContainsRune(t testing.T,
	expectedElement rune,
	container interface{},
	msg ...interface{}) bool

NotContainsRune tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `rune`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsString

func NotContainsString(t testing.T,
	expectedElement string,
	container interface{},
	msg ...interface{}) bool

NotContainsString tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `string`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsUint

func NotContainsUint(t testing.T,
	expectedElement uint,
	container interface{},
	msg ...interface{}) bool

NotContainsUint tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `uint`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsUint16

func NotContainsUint16(t testing.T,
	expectedElement uint16,
	container interface{},
	msg ...interface{}) bool

NotContainsUint16 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `uint16`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsUint32

func NotContainsUint32(t testing.T,
	expectedElement uint32,
	container interface{},
	msg ...interface{}) bool

NotContainsUint32 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `uint32`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsUint64

func NotContainsUint64(t testing.T,
	expectedElement uint64,
	container interface{},
	msg ...interface{}) bool

NotContainsUint64 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `uint64`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsUint8

func NotContainsUint8(t testing.T,
	expectedElement uint8,
	container interface{},
	msg ...interface{}) bool

NotContainsUint8 tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `uint8`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotContainsUintptr

func NotContainsUintptr(t testing.T,
	expectedElement uintptr,
	container interface{},
	msg ...interface{}) bool

NotContainsUintptr tests if `expectedElement` is contained within `container`. `container` can be a string, map, array or slice. The `container` must have elements of type `uintptr`. msg is an optional list of arguments following the `fmt.Printf()` format. You can use the typed versions of `NotContains` for more static typing. See also `Contains`.

func NotDeepEqual

func NotDeepEqual(t testing.T,
	left interface{},
	right interface{},
	msg ...interface{}) bool

NotDeepEqual tests if `left` != `right` using `reflect.DeepEqual`. msg is an optional list of arguments following the `fmt.Printf()` format. This is a deep, recursive non-equality test. See also `NotEqual`.

func NotEmpty

func NotEmpty(t testing.T, container interface{}, msg ...interface{}) bool

NotEmpty tests if the passed value is not Empty. Only a non-nil container with at least one element will pass the test. Uses Go len(). Container can be any of Array, Chan, Map, Slice, or String. See also `NotNil`. msg is an optional list of arguments following the `fmt.Printf()` format.

func NotEqual

func NotEqual(t testing.T,
	left interface{},
	right interface{},
	msg ...interface{}) bool

NotEqual tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two interface{} This is a strict non-equality test. It will pass only when `left` and `right` have identical type but non-equal values. For example, given int32(42) and int64(42), the test will fail because the types are not comparable. Given int32(42) and int32(42), the test will fail because the two values are equal. You can use the typed versions of `NotEqual` for more static typing. Note that Slice, map, and function values are not comparable. See also `NotDeepEqual`.

func NotEqualBool

func NotEqualBool(t testing.T,
	left bool,
	right bool,
	msg ...interface{}) bool

NotEqualBool tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two bool

func NotEqualByte

func NotEqualByte(t testing.T,
	left byte,
	right byte,
	msg ...interface{}) bool

NotEqualByte tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two byte

func NotEqualComplex128

func NotEqualComplex128(t testing.T,
	left complex128,
	right complex128,
	msg ...interface{}) bool

NotEqualComplex128 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two complex128

func NotEqualComplex64

func NotEqualComplex64(t testing.T,
	left complex64,
	right complex64,
	msg ...interface{}) bool

NotEqualComplex64 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two complex64

func NotEqualError

func NotEqualError(t testing.T,
	left error,
	right error,
	msg ...interface{}) bool

NotEqualError tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two error

func NotEqualFloat32

func NotEqualFloat32(t testing.T,
	left float32,
	right float32,
	msg ...interface{}) bool

NotEqualFloat32 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two float32

func NotEqualFloat64

func NotEqualFloat64(t testing.T,
	left float64,
	right float64,
	msg ...interface{}) bool

NotEqualFloat64 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two float64

func NotEqualInt

func NotEqualInt(t testing.T,
	left int,
	right int,
	msg ...interface{}) bool

NotEqualInt tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int

func NotEqualInt16

func NotEqualInt16(t testing.T,
	left int16,
	right int16,
	msg ...interface{}) bool

NotEqualInt16 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int16

func NotEqualInt32

func NotEqualInt32(t testing.T,
	left int32,
	right int32,
	msg ...interface{}) bool

NotEqualInt32 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int32

func NotEqualInt64

func NotEqualInt64(t testing.T,
	left int64,
	right int64,
	msg ...interface{}) bool

NotEqualInt64 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int64

func NotEqualInt8

func NotEqualInt8(t testing.T,
	left int8,
	right int8,
	msg ...interface{}) bool

NotEqualInt8 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two int8

func NotEqualRune

func NotEqualRune(t testing.T,
	left rune,
	right rune,
	msg ...interface{}) bool

NotEqualRune tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two rune

func NotEqualString

func NotEqualString(t testing.T,
	left string,
	right string,
	msg ...interface{}) bool

NotEqualString tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two string

func NotEqualTypes

func NotEqualTypes(t testing.T,
	left interface{},
	right interface{},
	msg ...interface{}) bool

NotEqualTypes tests if `left` and `right` have different types. msg is an optional list of arguments following the `fmt.Printf()` format. Example:

var a int32 = 42;
NotEqualType(t, int64(0), a)

func NotEqualUint

func NotEqualUint(t testing.T,
	left uint,
	right uint,
	msg ...interface{}) bool

NotEqualUint tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint

func NotEqualUint16

func NotEqualUint16(t testing.T,
	left uint16,
	right uint16,
	msg ...interface{}) bool

NotEqualUint16 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint16

func NotEqualUint32

func NotEqualUint32(t testing.T,
	left uint32,
	right uint32,
	msg ...interface{}) bool

NotEqualUint32 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint32

func NotEqualUint64

func NotEqualUint64(t testing.T,
	left uint64,
	right uint64,
	msg ...interface{}) bool

NotEqualUint64 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint64

func NotEqualUint8

func NotEqualUint8(t testing.T,
	left uint8,
	right uint8,
	msg ...interface{}) bool

NotEqualUint8 tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uint8

func NotEqualUintptr

func NotEqualUintptr(t testing.T,
	left uintptr,
	right uintptr,
	msg ...interface{}) bool

NotEqualUintptr tests if `left` is not equal to `right` using the `!=` operator. The left value comes first, followed by the value to test against. msg is an optional list of arguments following the `fmt.Printf()` format. This version takes takes two uintptr

func NotNil

func NotNil(t testing.T, tval interface{}, msg ...interface{}) bool

NotNil tests if the passed value is not Nil. See also NotEmpty. msg is an optional list of arguments following the `fmt.Printf()` format.

func Panics

func Panics(t testing.T, f func(), msg ...interface{}) bool

Panics asserts that the code inside the specified function f panics.

assert.Panics(t, func(){ GoCrazy() })

func PanicsWith

func PanicsWith(t testing.T,
	expected interface{},
	f func(),
	msg ...interface{}) bool

PanicsWith asserts that the code inside the specified function f panics, and that the recovered panic value equals the expected panic value

assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })

func True

func True(t testing.T, tval bool, msg ...interface{}) bool

True tests if val is True. msg is an optional list of arguments following the `fmt.Printf()` format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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