# Functions
CallerInfo returns an array of strings containing the file and line number of each stack frame leading from the current test to the assert call that failed.
Condition uses a Comparison to assert a complex condition.
Conditionf uses a Comparison to assert a complex condition.
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element.
Containsf asserts that the specified string, list(array, slice...) or map contains the specified substring or element.
DirExists checks whether a directory exists in the given path.
DirExistsf checks whether a directory exists in the given path.
ElementsMatch asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements.
ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements.
Empty asserts that the specified object is empty.
Emptyf asserts that the specified object is empty.
Equal asserts that two objects are equal.
EqualError asserts that a function returned an error (i.e.
EqualErrorf asserts that a function returned an error (i.e.
Equalf asserts that two objects are equal.
EqualValues asserts that two objects are equal or convertable to the same types and equal.
EqualValuesf asserts that two objects are equal or convertable to the same types and equal.
Error asserts that a function returned an error (i.e.
Errorf asserts that a function returned an error (i.e.
Exactly asserts that two objects are equal in value and type.
Exactlyf asserts that two objects are equal in value and type.
Fail reports a failure through.
Failf reports a failure through.
FailNow fails test.
FailNowf fails test.
False asserts that the specified value is false.
Falsef asserts that the specified value is false.
FileExists checks whether a file exists in the given path.
FileExistsf checks whether a file exists in the given path.
HTTPBody is a helper that returns HTTP body of the response.
HTTPBodyContains asserts that a specified handler returns a body that contains a string.
HTTPBodyContainsf asserts that a specified handler returns a body that contains a string.
HTTPBodyNotContains asserts that a specified handler returns a body that does not contain a string.
HTTPBodyNotContainsf asserts that a specified handler returns a body that does not contain a string.
HTTPError asserts that a specified handler returns an error status code.
HTTPErrorf asserts that a specified handler returns an error status code.
HTTPRedirect asserts that a specified handler returns a redirect status code.
HTTPRedirectf asserts that a specified handler returns a redirect status code.
HTTPSuccess asserts that a specified handler returns a success status code.
HTTPSuccessf asserts that a specified handler returns a success status code.
Implements asserts that an object is implemented by the specified interface.
Implementsf asserts that an object is implemented by the specified interface.
InDelta asserts that the two numerals are within delta of each other.
InDeltaf asserts that the two numerals are within delta of each other.
InDeltaMapValues is the same as InDelta, but it compares all values between two maps.
InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps.
InDeltaSlice is the same as InDelta, except it compares two slices.
InDeltaSlicef is the same as InDelta, except it compares two slices.
InEpsilon asserts that expected and actual have a relative error less than epsilon.
InEpsilonf asserts that expected and actual have a relative error less than epsilon.
InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices.
IsType asserts that the specified objects are of the same type.
IsTypef asserts that the specified objects are of the same type.
JSONEq asserts that two JSON strings are equivalent.
JSONEqf asserts that two JSON strings are equivalent.
Len asserts that the specified object has specific length.
Lenf asserts that the specified object has specific length.
New makes a new Assertions object for the specified TestingT.
Nil asserts that the specified object is nil.
Nilf asserts that the specified object is nil.
NoError asserts that a function returned no error (i.e.
NoErrorf asserts that a function returned no error (i.e.
NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element.
NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element.
NotEmpty asserts that the specified object is NOT empty.
NotEmptyf asserts that the specified object is NOT empty.
NotEqual asserts that the specified values are NOT equal.
NotEqualf asserts that the specified values are NOT equal.
NotNil asserts that the specified object is not nil.
NotNilf asserts that the specified object is not nil.
NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.
NotRegexp asserts that a specified regexp does not match a string.
NotRegexpf asserts that a specified regexp does not match a string.
NotSubset asserts that the specified list(array, slice...) contains not all elements given in the specified subset(array, slice...).
NotSubsetf asserts that the specified list(array, slice...) contains not all elements given in the specified subset(array, slice...).
NotZero asserts that i is not the zero value for its type.
NotZerof asserts that i is not the zero value for its type.
ObjectsAreEqual determines if two objects are considered equal.
ObjectsAreEqualValues gets whether two objects are equal, or if their values are equal.
Panics asserts that the code inside the specified PanicTestFunc panics.
Panicsf asserts that the code inside the specified PanicTestFunc panics.
PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value equals the expected panic value.
PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value equals the expected panic value.
Regexp asserts that a specified regexp matches a string.
Regexpf asserts that a specified regexp matches a string.
Subset asserts that the specified list(array, slice...) contains all elements given in the specified subset(array, slice...).
Subsetf asserts that the specified list(array, slice...) contains all elements given in the specified subset(array, slice...).
True asserts that the specified value is true.
Truef asserts that the specified value is true.
WithinDuration asserts that the two times are within duration delta of each other.
WithinDurationf asserts that the two times are within duration delta of each other.
Zero asserts that i is the zero value for its type.
Zerof asserts that i is the zero value for its type.
# Variables
AnError is an error instance useful for testing.
# Structs
Assertions provides assertion methods around the TestingT interface.
# Interfaces
TestingT is an interface wrapper around *testing.T.
# Type aliases
BoolAssertionFunc is a common function prototype when validating a bool value.
Comparison a custom function that returns true on success and false on failure.
ComparisonAssertionFunc is a common function prototype when comparing two values.
ValuesAssertionFunc is a common function prototype when validating an error value.
PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics methods, and represents a simple func that takes no arguments, and returns nothing.
ValueAssertionFunc is a common function prototype when validating a single value.