// Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT.package assertimport (httpurltime)// Conditionf uses a Comparison to assert a complex condition.func ( TestingT, Comparison, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnCondition(, , append([]interface{}{}, ...)...)}// Containsf asserts that the specified string, list(array, slice...) or map contains the// specified substring or element.//// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted")// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnContains(, , , append([]interface{}{}, ...)...)}// DirExistsf checks whether a directory exists in the given path. It also fails// if the path is a file rather a directory or there is an error checking whether it exists.func ( TestingT, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnDirExists(, , append([]interface{}{}, ...)...)}// ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,// the number of appearances of each of them in both lists should match.//// assert.ElementsMatchf(t, [1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnElementsMatch(, , , append([]interface{}{}, ...)...)}// Emptyf asserts that the given value is "empty".//// [Zero values] are "empty".//// Arrays are "empty" if every element is the zero value of the type (stricter than "empty").//// Slices, maps and channels with zero length are "empty".//// Pointer values are "empty" if the pointer is nil or if the pointed value is "empty".//// assert.Emptyf(t, obj, "error message %s", "formatted")//// [Zero values]: https://go.dev/ref/spec#The_zero_valuefunc ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEmpty(, , append([]interface{}{}, ...)...)}// Equalf asserts that two objects are equal.//// assert.Equalf(t, 123, 123, "error message %s", "formatted")//// Pointer variable equality is determined based on the equality of the// referenced values (as opposed to the memory addresses). Function equality// cannot be determined and will always fail.func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEqual(, , , append([]interface{}{}, ...)...)}// EqualErrorf asserts that a function returned an error (i.e. not `nil`)// and that it is equal to the provided error.//// actualObj, err := SomeFunction()// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")func ( TestingT, error, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEqualError(, , , append([]interface{}{}, ...)...)}// EqualExportedValuesf asserts that the types of two objects are equal and their public// fields are also equal. This is useful for comparing structs that have private fields// that could potentially differ.//// type S struct {// Exported int// notExported int// }// assert.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true// assert.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => falsefunc ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEqualExportedValues(, , , append([]interface{}{}, ...)...)}// EqualValuesf asserts that two objects are equal or convertible to the larger// type and equal.//// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEqualValues(, , , append([]interface{}{}, ...)...)}// Errorf asserts that a function returned an error (i.e. not `nil`).//// actualObj, err := SomeFunction()// assert.Errorf(t, err, "error message %s", "formatted")func ( TestingT, error, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnError(, , append([]interface{}{}, ...)...)}// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.// This is a wrapper for errors.As.func ( TestingT, error, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnErrorAs(, , , append([]interface{}{}, ...)...)}// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)// and that the error contains the specified substring.//// actualObj, err := SomeFunction()// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")func ( TestingT, error, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnErrorContains(, , , append([]interface{}{}, ...)...)}// ErrorIsf asserts that at least one of the errors in err's chain matches target.// This is a wrapper for errors.Is.func ( TestingT, error, error, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnErrorIs(, , , append([]interface{}{}, ...)...)}// Eventuallyf asserts that given condition will be met in waitFor time,// periodically checking target function each tick.//// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")func ( TestingT, func() bool, time.Duration, time.Duration, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEventually(, , , , append([]interface{}{}, ...)...)}// EventuallyWithTf asserts that given condition will be met in waitFor time,// periodically checking target function each tick. In contrast to Eventually,// it supplies a CollectT to the condition function, so that the condition// function can use the CollectT to call other assertions.// The condition is considered "met" if no errors are raised in a tick.// The supplied CollectT collects all errors from one tick (if there are any).// If the condition is not met before waitFor, the collected errors of// the last tick are copied to t.//// externalValue := false// go func() {// time.Sleep(8*time.Second)// externalValue = true// }()// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") {// // add assertions as needed; any assertion failure will fail the current tick// assert.True(c, externalValue, "expected 'externalValue' to be true")// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false")func ( TestingT, func( *CollectT), time.Duration, time.Duration, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnEventuallyWithT(, , , , append([]interface{}{}, ...)...)}// Exactlyf asserts that two objects are equal in value and type.//// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnExactly(, , , append([]interface{}{}, ...)...)}// Failf reports a failure throughfunc ( TestingT, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnFail(, , append([]interface{}{}, ...)...)}// FailNowf fails testfunc ( TestingT, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnFailNow(, , append([]interface{}{}, ...)...)}// Falsef asserts that the specified value is false.//// assert.Falsef(t, myBool, "error message %s", "formatted")func ( TestingT, bool, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnFalse(, , append([]interface{}{}, ...)...)}// FileExistsf checks whether a file exists in the given path. It also fails if// the path points to a directory or there is an error when trying to check the file.func ( TestingT, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnFileExists(, , append([]interface{}{}, ...)...)}// 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")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnGreater(, , , append([]interface{}{}, ...)...)}// 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")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnGreaterOrEqual(, , , append([]interface{}{}, ...)...)}// HTTPBodyContainsf asserts that a specified handler returns a// body that contains a string.//// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")//// Returns whether the assertion was successful (true) or not (false).func ( TestingT, http.HandlerFunc, string, string, url.Values, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnHTTPBodyContains(, , , , , , append([]interface{}{}, ...)...)}// HTTPBodyNotContainsf asserts that a specified handler returns a// body that does not contain a string.//// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")//// Returns whether the assertion was successful (true) or not (false).func ( TestingT, http.HandlerFunc, string, string, url.Values, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnHTTPBodyNotContains(, , , , , , append([]interface{}{}, ...)...)}// HTTPErrorf asserts that a specified handler returns an error status code.//// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}//// Returns whether the assertion was successful (true) or not (false).func ( TestingT, http.HandlerFunc, string, string, url.Values, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnHTTPError(, , , , , append([]interface{}{}, ...)...)}// HTTPRedirectf asserts that a specified handler returns a redirect status code.//// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}//// Returns whether the assertion was successful (true) or not (false).func ( TestingT, http.HandlerFunc, string, string, url.Values, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnHTTPRedirect(, , , , , append([]interface{}{}, ...)...)}// HTTPStatusCodef asserts that a specified handler returns a specified status code.//// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")//// Returns whether the assertion was successful (true) or not (false).func ( TestingT, http.HandlerFunc, string, string, url.Values, int, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnHTTPStatusCode(, , , , , , append([]interface{}{}, ...)...)}// HTTPSuccessf asserts that a specified handler returns a success status code.//// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")//// Returns whether the assertion was successful (true) or not (false).func ( TestingT, http.HandlerFunc, string, string, url.Values, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnHTTPSuccess(, , , , , append([]interface{}{}, ...)...)}// Implementsf asserts that an object is implemented by the specified interface.//// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnImplements(, , , append([]interface{}{}, ...)...)}// InDeltaf asserts that the two numerals are within delta of each other.//// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")func ( TestingT, interface{}, interface{}, float64, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnInDelta(, , , , append([]interface{}{}, ...)...)}// InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.func ( TestingT, interface{}, interface{}, float64, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnInDeltaMapValues(, , , , append([]interface{}{}, ...)...)}// InDeltaSlicef is the same as InDelta, except it compares two slices.func ( TestingT, interface{}, interface{}, float64, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnInDeltaSlice(, , , , append([]interface{}{}, ...)...)}// InEpsilonf asserts that expected and actual have a relative error less than epsilonfunc ( TestingT, interface{}, interface{}, float64, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnInEpsilon(, , , , append([]interface{}{}, ...)...)}// InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices.func ( TestingT, interface{}, interface{}, float64, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnInEpsilonSlice(, , , , append([]interface{}{}, ...)...)}// IsDecreasingf asserts that the collection is decreasing//// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted")// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted")// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnIsDecreasing(, , append([]interface{}{}, ...)...)}// IsIncreasingf asserts that the collection is increasing//// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted")// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted")// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnIsIncreasing(, , append([]interface{}{}, ...)...)}// IsNonDecreasingf asserts that the collection is not decreasing//// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted")// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted")// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnIsNonDecreasing(, , append([]interface{}{}, ...)...)}// IsNonIncreasingf asserts that the collection is not increasing//// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted")// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted")// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnIsNonIncreasing(, , append([]interface{}{}, ...)...)}// IsNotTypef asserts that the specified objects are not of the same type.//// assert.IsNotTypef(t, &NotMyStruct{}, &MyStruct{}, "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnIsNotType(, , , append([]interface{}{}, ...)...)}// IsTypef asserts that the specified objects are of the same type.//// assert.IsTypef(t, &MyStruct{}, &MyStruct{}, "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnIsType(, , , append([]interface{}{}, ...)...)}// JSONEqf asserts that two JSON strings are equivalent.//// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")func ( TestingT, string, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnJSONEq(, , , append([]interface{}{}, ...)...)}// Lenf asserts that the specified object has specific length.// Lenf also fails if the object has a type that len() not accept.//// assert.Lenf(t, mySlice, 3, "error message %s", "formatted")func ( TestingT, interface{}, int, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnLen(, , , append([]interface{}{}, ...)...)}// 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")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnLess(, , , append([]interface{}{}, ...)...)}// 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")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnLessOrEqual(, , , append([]interface{}{}, ...)...)}// 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")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNegative(, , append([]interface{}{}, ...)...)}// Neverf asserts that the given condition doesn't satisfy in waitFor time,// periodically checking the target function each tick.//// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")func ( TestingT, func() bool, time.Duration, time.Duration, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNever(, , , , append([]interface{}{}, ...)...)}// Nilf asserts that the specified object is nil.//// assert.Nilf(t, err, "error message %s", "formatted")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNil(, , append([]interface{}{}, ...)...)}// NoDirExistsf checks whether a directory does not exist in the given path.// It fails if the path points to an existing _directory_ only.func ( TestingT, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNoDirExists(, , append([]interface{}{}, ...)...)}// NoErrorf asserts that a function returned no error (i.e. `nil`).//// actualObj, err := SomeFunction()// if assert.NoErrorf(t, err, "error message %s", "formatted") {// assert.Equal(t, expectedObj, actualObj)// }func ( TestingT, error, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNoError(, , append([]interface{}{}, ...)...)}// NoFileExistsf checks whether a file does not exist in a given path. It fails// if the path points to an existing _file_ only.func ( TestingT, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNoFileExists(, , append([]interface{}{}, ...)...)}// NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the// specified substring or element.//// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted")// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted")// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotContains(, , , append([]interface{}{}, ...)...)}// NotElementsMatchf asserts that the specified listA(array, slice...) is NOT equal to specified// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,// the number of appearances of each of them in both lists should not match.// This is an inverse of ElementsMatch.//// assert.NotElementsMatchf(t, [1, 1, 2, 3], [1, 1, 2, 3], "error message %s", "formatted") -> false//// assert.NotElementsMatchf(t, [1, 1, 2, 3], [1, 2, 3], "error message %s", "formatted") -> true//// assert.NotElementsMatchf(t, [1, 2, 3], [1, 2, 4], "error message %s", "formatted") -> truefunc ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotElementsMatch(, , , append([]interface{}{}, ...)...)}// NotEmptyf asserts that the specified object is NOT [Empty].//// if assert.NotEmptyf(t, obj, "error message %s", "formatted") {// assert.Equal(t, "two", obj[1])// }func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotEmpty(, , append([]interface{}{}, ...)...)}// NotEqualf asserts that the specified values are NOT equal.//// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted")//// Pointer variable equality is determined based on the equality of the// referenced values (as opposed to the memory addresses).func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotEqual(, , , append([]interface{}{}, ...)...)}// NotEqualValuesf asserts that two objects are not equal even when converted to the same type//// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotEqualValues(, , , append([]interface{}{}, ...)...)}// NotErrorAsf asserts that none of the errors in err's chain matches target,// but if so, sets target to that error value.func ( TestingT, error, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotErrorAs(, , , append([]interface{}{}, ...)...)}// NotErrorIsf asserts that none of the errors in err's chain matches target.// This is a wrapper for errors.Is.func ( TestingT, error, error, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotErrorIs(, , , append([]interface{}{}, ...)...)}// NotImplementsf asserts that an object does not implement the specified interface.//// assert.NotImplementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotImplements(, , , append([]interface{}{}, ...)...)}// NotNilf asserts that the specified object is not nil.//// assert.NotNilf(t, err, "error message %s", "formatted")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotNil(, , append([]interface{}{}, ...)...)}// NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.//// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted")func ( TestingT, PanicTestFunc, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotPanics(, , append([]interface{}{}, ...)...)}// NotRegexpf asserts that a specified regexp does not match a string.//// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotRegexp(, , , append([]interface{}{}, ...)...)}// NotSamef asserts that two pointers do not reference the same object.//// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted")//// Both arguments must be pointer variables. Pointer variable sameness is// determined based on the equality of both type and value.func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotSame(, , , append([]interface{}{}, ...)...)}// NotSubsetf asserts that the list (array, slice, or map) does NOT contain all// elements given in the subset (array, slice, or map).// Map elements are key-value pairs unless compared with an array or slice where// only the map key is evaluated.//// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "error message %s", "formatted")// assert.NotSubsetf(t, {"x": 1, "y": 2}, {"z": 3}, "error message %s", "formatted")// assert.NotSubsetf(t, [1, 3, 4], {1: "one", 2: "two"}, "error message %s", "formatted")// assert.NotSubsetf(t, {"x": 1, "y": 2}, ["z"], "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotSubset(, , , append([]interface{}{}, ...)...)}// NotZerof asserts that i is not the zero value for its type.func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnNotZero(, , append([]interface{}{}, ...)...)}// Panicsf asserts that the code inside the specified PanicTestFunc panics.//// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")func ( TestingT, PanicTestFunc, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnPanics(, , append([]interface{}{}, ...)...)}// PanicsWithErrorf asserts that the code inside the specified PanicTestFunc// panics, and that the recovered panic value is an error that satisfies the// EqualError comparison.//// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")func ( TestingT, string, PanicTestFunc, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnPanicsWithError(, , , append([]interface{}{}, ...)...)}// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that// the recovered panic value equals the expected panic value.//// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")func ( TestingT, interface{}, PanicTestFunc, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnPanicsWithValue(, , , append([]interface{}{}, ...)...)}// 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")func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnPositive(, , append([]interface{}{}, ...)...)}// Regexpf asserts that a specified regexp matches a string.//// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnRegexp(, , , append([]interface{}{}, ...)...)}// Samef asserts that two pointers reference the same object.//// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")//// Both arguments must be pointer variables. Pointer variable sameness is// determined based on the equality of both type and value.func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnSame(, , , append([]interface{}{}, ...)...)}// Subsetf asserts that the list (array, slice, or map) contains all elements// given in the subset (array, slice, or map).// Map elements are key-value pairs unless compared with an array or slice where// only the map key is evaluated.//// assert.Subsetf(t, [1, 2, 3], [1, 2], "error message %s", "formatted")// assert.Subsetf(t, {"x": 1, "y": 2}, {"x": 1}, "error message %s", "formatted")// assert.Subsetf(t, [1, 2, 3], {1: "one", 2: "two"}, "error message %s", "formatted")// assert.Subsetf(t, {"x": 1, "y": 2}, ["x"], "error message %s", "formatted")func ( TestingT, interface{}, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnSubset(, , , append([]interface{}{}, ...)...)}// Truef asserts that the specified value is true.//// assert.Truef(t, myBool, "error message %s", "formatted")func ( TestingT, bool, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnTrue(, , append([]interface{}{}, ...)...)}// WithinDurationf asserts that the two times are within duration delta of each other.//// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")func ( TestingT, time.Time, time.Time, time.Duration, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnWithinDuration(, , , , append([]interface{}{}, ...)...)}// WithinRangef asserts that a time is within a time range (inclusive).//// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")func ( TestingT, time.Time, time.Time, time.Time, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnWithinRange(, , , , append([]interface{}{}, ...)...)}// YAMLEqf asserts that two YAML strings are equivalent.func ( TestingT, string, string, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnYAMLEq(, , , append([]interface{}{}, ...)...)}// Zerof asserts that i is the zero value for its type.func ( TestingT, interface{}, string, ...interface{}) bool {if , := .(tHelper); { .Helper() }returnZero(, , append([]interface{}{}, ...)...)}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.