assert

package
v2.3.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

type Helper interface {
	// GetTest retrieves the test for which assertion facilities are being provided.
	GetTest() *testing.T

	// IsTrue asserts that the specified condition is true.
	IsTrue(description string, condition bool)

	// IsFalse asserts that the specified condition is true.
	IsFalse(description string, condition bool)

	// IsNil asserts that the specified value is nil.
	IsNil(description string, actual interface{})

	// IsNil asserts that the specified value is not nil.
	NotNil(description string, actual interface{})

	// Equals asserts that the specified values are equal.
	//
	// Uses reflect.DeepEquals.
	Equals(description string, expected interface{}, actual interface{})

	// EqualsString asserts that the specified string values are equal.
	EqualsString(description string, expected string, actual string)

	// EqualsInt asserts that the specified int values are equal.
	EqualsInt(description string, expected int, actual int)
}

Helper performs assertions for a specific test.

func ForTest

func ForTest(test *testing.T) Helper

ForTest creates a new assertion Helper for the specified test.

Jump to

Keyboard shortcuts

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