require

package
v0.0.0-...-3d2f39d Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(
	tb TestingTB,
	expected interface{},
	actual interface{},
	msgs ...interface{},
)

DeepEqual compares values using DeepEqual. NOTE: this function does not work for checking arrays/slices or maps of protobuf messages. For arrays/slices, please use DeepSSZEqual. For maps, please iterate through and compare the individual keys and values.

func DeepNotEqual

func DeepNotEqual(
	tb TestingTB,
	expected interface{},
	actual interface{},
	msgs ...interface{},
)

DeepNotEqual compares values using DeepEqual. NOTE: this function does not work for checking arrays/slices or maps of protobuf messages. For arrays/slices, please use DeepNotSSZEqual. For maps, please iterate through and compare the individual keys and values.

func DeepNotSSZEqual

func DeepNotSSZEqual(
	tb TestingTB,
	expected interface{},
	actual interface{},
	msgs ...interface{},
)

DeepNotSSZEqual compares values using DeepEqual.

func DeepSSZEqual

func DeepSSZEqual(
	tb TestingTB,
	expected interface{},
	actual interface{},
	msgs ...interface{},
)

DeepSSZEqual compares values using DeepEqual.

func Equal

func Equal(
	tb TestingTB,
	expected interface{},
	actual interface{},
	msgs ...interface{},
)

Equal compares values using comparison operator.

func ErrorContains

func ErrorContains(
	tb TestingTB,
	want string,
	err error,
	msgs ...interface{},
)

ErrorContains asserts that actual error contains wanted message.

func ErrorIs

func ErrorIs(
	tb TestingTB,
	target error,
	err error,
	msgs ...interface{},
)

ErrorIs uses Errors.Is to recursively unwrap err looking for target in the chain. If any error in the chain matches target, the assertion will pass.

func Fail

func Fail(tb TestingTB, msgs ...interface{})

Fail unconditionally.

func False

func False(tb TestingTB, actual bool, msgs ...interface{})

False asserts value is false.

func LogsContain

func LogsContain(
	tb TestingTB,
	hook *test.Hook,
	want string,
	msgs ...interface{},
)

LogsContain checks that the desired string is a subset of the current log output.

func LogsDoNotContain

func LogsDoNotContain(
	tb TestingTB,
	hook *test.Hook,
	want string,
	msgs ...interface{},
)

LogsDoNotContain is the inverse check of LogsContain.

func Nil

func Nil(tb TestingTB, obj interface{}, msgs ...interface{})

Nil asserts that passed value is nil.

func NoError

func NoError(tb TestingTB, err error, msgs ...interface{})

NoError asserts that error is nil.

func NotEmpty

func NotEmpty(tb TestingTB, obj interface{}, msgs ...interface{})

NotEmpty checks that the object fields are not empty. This method also checks all of the pointer fields to ensure none of those fields are empty.

func NotEqual

func NotEqual(
	tb TestingTB,
	expected interface{},
	actual interface{},
	msgs ...interface{},
)

NotEqual compares values using comparison operator.

func NotNil

func NotNil(tb TestingTB, obj interface{}, msgs ...interface{})

NotNil asserts that passed value is not nil.

func Panic

func Panic(tb TestingTB, f func(), msgs ...interface{})

Panic asserts value is true.

func True

func True(tb TestingTB, actual bool, msgs ...interface{})

True asserts value is true.

Types

type TestingTB

type TestingTB interface {
	Fatalf(format string, args ...interface{})
}

Jump to

Keyboard shortcuts

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