# Functions
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.
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.
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 convertible to the same types and equal.
EqualValuesf asserts that two objects are equal or convertible to the same types and equal.
Error asserts that a function returned an error (i.e.
ErrorContains asserts that a function returned an error (i.e.
ErrorContainsf asserts that a function returned an error (i.e.
Errorf asserts that a function returned an error (i.e.
Eventually asserts that given condition will be met in waitFor time, periodically checking target function each tick.
Eventuallyf asserts that given condition will be met in waitFor time, periodically checking target function each tick.
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.
Greater asserts that the first element is greater than the second
assert.Greater(t, 2, 1) assert.Greater(t, float64(2), float64(1)) assert.Greater(t, "b", "a").
Greaterf asserts that the first element is greater than the second
assert.Greaterf(t, 2, 1, "error message %s", "formatted") assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") assert.Greaterf(t, "b", "a", "error message %s", "formatted").
GreaterOrEqual asserts that the first element is greater than or equal to the second
assert.GreaterOrEqual(t, 2, 1) assert.GreaterOrEqual(t, 2, 2) assert.GreaterOrEqual(t, "b", "a") assert.GreaterOrEqual(t, "b", "b").
GreaterOrEqualf asserts that the first element is greater than or equal to the second
assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted").
InDelta asserts that the two numerals are within delta of each other.
InDeltaf asserts that the two numerals are within delta of each other.
IsType asserts that the specified objects are of the same type.
IsTypef asserts that the specified objects are of the same type.
Len asserts that the specified object has specific length.
Lenf asserts that the specified object has specific length.
Less asserts that the first element is less than the second
assert.Less(t, 1, 2) assert.Less(t, float64(1), float64(2)) assert.Less(t, "a", "b").
Lessf asserts that the first element is less than the second
assert.Lessf(t, 1, 2, "error message %s", "formatted") assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") assert.Lessf(t, "a", "b", "error message %s", "formatted").
LessOrEqual asserts that the first element is less than or equal to the second
assert.LessOrEqual(t, 1, 2) assert.LessOrEqual(t, 2, 2) assert.LessOrEqual(t, "a", "b") assert.LessOrEqual(t, "b", "b").
LessOrEqualf asserts that the first element is less than or equal to the second
assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted") assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted") assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted") assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted").
Negative asserts that the specified element is negative
assert.Negative(t, -1) assert.Negative(t, -1.23).
Negativef asserts that the specified element is negative
assert.Negativef(t, -1, "error message %s", "formatted") assert.Negativef(t, -1.23, "error message %s", "formatted").
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.
NotEqual asserts that the specified values are NOT equal.
NotEqualf asserts that the specified values are NOT equal.
NotEqualValues asserts that two objects are not equal even when converted to the same type
assert.NotEqualValues(t, obj1, obj2).
NotEqualValuesf asserts that two objects are not equal even when converted to the same type
assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted").
NotNil asserts that the specified object is not nil.
NotNilf asserts that the specified object is not nil.
Positive asserts that the specified element is positive
assert.Positive(t, 1) assert.Positive(t, 1.23).
Positivef asserts that the specified element is positive
assert.Positivef(t, 1, "error message %s", "formatted") assert.Positivef(t, 1.23, "error message %s", "formatted").
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.
# Interfaces
TestingT is an interface wrapper around *testing.T.