MCPcopy Create free account

hub / github.com/stretchr/testify / functions

Functions1,305 in github.com/stretchr/testify

↓ 2 callersFunctionisArgsEqual
isArgsEqual compares arguments
mock/mock.go:732
↓ 2 callersFunctionisList
isList checks that the provided value is array or slice.
assert/assertions.go:1109
↓ 2 callersFunctionmatchRegexp
matchRegexp return true if a specified regexp matches a string.
assert/assertions.go:1654
↓ 2 callersFunctionnewCall
(parent *Mock, methodName string, callerInfo []string, methodArguments Arguments, returnArguments Arguments)
mock/mock.go:83
↓ 2 callersFunctionrecoverAndFailOnPanic
(t *testing.T)
suite/suite.go:80
↓ 2 callersFunctiontoFloat
(x interface{})
assert/assertions.go:1354
↓ 2 callersFunctiontruncatingFormat
truncatingFormat formats the data and truncates it if it's too long. This helps keep formatted error messages lines from exceeding the bufio.MaxScanT
assert/assertions.go:586
↓ 1 callersMethodAfterTest
(suiteName, testName string)
suite/interfaces.go:46
↓ 1 callersMethodAssert
Assert compares the arguments with the specified objects and fails if they do not exactly match.
mock/mock.go:1051
↓ 1 callersMethodAssertNotCalled
AssertNotCalled asserts that the method was not called. It can produce a false result when an argument is a pointer type and the underlying value chan
mock/mock.go:692
↓ 1 callersMethodAssertNumberOfCalls
AssertNumberOfCalls asserts that the method was called expectedCalls times.
mock/mock.go:652
↓ 1 callersMethodBeforeTest
(suiteName, testName string)
suite/interfaces.go:40
↓ 1 callersMethodCall
()
mock/mock_test.go:2246
↓ 1 callersFunctionConcurrencyTestMethod
go:noinline
mock/mock_test.go:2215
↓ 1 callersFunctionCondition
Condition uses a Comparison to assert a complex condition.
require/require.go:13
↓ 1 callersMethodCondition
Condition uses a Comparison to assert a complex condition.
assert/assertion_forward.go:12
↓ 1 callersFunctionConditionf
Conditionf uses a Comparison to assert a complex condition.
require/require.go:24
↓ 1 callersMethodContains
Contains asserts that the specified string, list(array, slice...) or map contains the specified substring or element. a.Contains("Hello World", "Wor
require/require_forward.go:34
↓ 1 callersFunctionContainsf
Containsf asserts that the specified string, list(array, slice...) or map contains the specified substring or element. require.Containsf(t, "Hello W
require/require.go:56
↓ 1 callersFunctionDirExists
DirExists 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 wh
require/require.go:68
↓ 1 callersFunctionDirExistsf
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 w
require/require.go:80
↓ 1 callersFunctionElementsMatch
ElementsMatch asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements. If th
require/require.go:95
↓ 1 callersFunctionElementsMatchf
ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements. If t
require/require.go:110
↓ 1 callersMethodEmpty
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. a.Empty(obj)
assert/assertion_forward.go:99
↓ 1 callersMethodEmpty
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. a.Empty(obj)
require/require_forward.go:100
↓ 1 callersFunctionEmptyf
Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. require.Emptyf(t, obj, "err
require/require.go:138
↓ 1 callersMethodEqualError
EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction()
assert/assertion_forward.go:136
↓ 1 callersMethodEqualError
EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction()
require/require_forward.go:137
↓ 1 callersFunctionEqualErrorf
EqualErrorf asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction()
require/require.go:185
↓ 1 callersFunctionEqualExportedValues
EqualExportedValues asserts that the types of two objects are equal and their public fields are also equal. This is useful for comparing structs that
require/require.go:205
↓ 1 callersFunctionEqualExportedValuesf
EqualExportedValuesf asserts that the types of two objects are equal and their public fields are also equal. This is useful for comparing structs that
require/require.go:225
↓ 1 callersFunctionEqualValues
EqualValues asserts that two objects are equal or convertible to the larger type and equal. require.EqualValues(t, uint32(123), int32(123))
require/require.go:239
↓ 1 callersMethodEqualValues
EqualValues asserts that two objects are equal or convertible to the larger type and equal. a.EqualValues(uint32(123), int32(123))
assert/assertion_forward.go:193
↓ 1 callersFunctionEqualValuesf
EqualValuesf asserts that two objects are equal or convertible to the larger type and equal. require.EqualValuesf(t, uint32(123), int32(123), "error
require/require.go:253
↓ 1 callersFunctionEqualf
Equalf asserts that two objects are equal. require.Equalf(t, 123, 123, "error message %s", "formatted") Pointer variable equality is determined bas
require/require.go:270
↓ 1 callersFunctionErrorAs
ErrorAs 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 error
require/require.go:298
↓ 1 callersFunctionErrorAsf
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 erro
require/require.go:310
↓ 1 callersMethodErrorContains
ErrorContains asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := Some
assert/assertion_forward.go:261
↓ 1 callersMethodErrorContains
ErrorContains asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := Some
require/require_forward.go:262
↓ 1 callersFunctionErrorContainsf
ErrorContainsf asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := Som
require/require.go:340
↓ 1 callersFunctionErrorIs
ErrorIs asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
require/require.go:352
↓ 1 callersFunctionErrorIsf
ErrorIsf asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
require/require.go:364
↓ 1 callersFunctionErrorf
Errorf asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if require.Errorf(t, err, "error message %s
require/require.go:380
↓ 1 callersFunctionEventually
Eventually asserts that given condition will be met in waitFor time, periodically checking target function each tick. require.Eventually(t, func() b
require/require.go:394
↓ 1 callersFunctionEventuallyWithTf
EventuallyWithTf asserts that given condition will be met in waitFor time, periodically checking target function each tick. In contrast to Eventually,
require/require.go:450
↓ 1 callersFunctionEventuallyf
Eventuallyf asserts that given condition will be met in waitFor time, periodically checking target function each tick. require.Eventuallyf(t, func()
require/require.go:464
↓ 1 callersMethodExactly
Exactly asserts that two objects are equal in value and type. a.Exactly(int32(123), int64(123))
assert/assertion_forward.go:386
↓ 1 callersMethodExactly
Exactly asserts that two objects are equal in value and type. a.Exactly(int32(123), int64(123))
require/require_forward.go:387
↓ 1 callersFunctionExactlyf
Exactlyf asserts that two objects are equal in value and type. require.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")
require/require.go:490
↓ 1 callersFunctionFail
Fail reports a failure through
require/require.go:501
↓ 1 callersFunctionFailNow
FailNow fails test
require/require.go:512
↓ 1 callersFunctionFailNowf
FailNowf fails test
require/require.go:523
↓ 1 callersFunctionFailf
Failf reports a failure through
require/require.go:534
↓ 1 callersFunctionFalsef
Falsef asserts that the specified value is false. require.Falsef(t, myBool, "error message %s", "formatted")
require/require.go:560
↓ 1 callersFunctionFileExists
FileExists 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 t
require/require.go:572
↓ 1 callersFunctionFileExistsf
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
require/require.go:584
↓ 1 callersMethodForwardedParams
()
_codegen/main.go:253
↓ 1 callersMethodGetTimes
(times []int)
mock/mock_test.go:2026
↓ 1 callersFunctionGreater
Greater asserts that the first element is greater than the second require.Greater(t, 2, 1) require.Greater(t, float64(2), float64(1)) require.Grea
require/require.go:599
↓ 1 callersFunctionGreaterOrEqual
GreaterOrEqual asserts that the first element is greater than or equal to the second require.GreaterOrEqual(t, 2, 1) require.GreaterOrEqual(t, 2, 2
require/require.go:615
↓ 1 callersFunctionGreaterOrEqualf
GreaterOrEqualf asserts that the first element is greater than or equal to the second require.GreaterOrEqualf(t, 2, 1, "error message %s", "formatte
require/require.go:631
↓ 1 callersFunctionGreaterf
Greaterf asserts that the first element is greater than the second require.Greaterf(t, 2, 1, "error message %s", "formatted") require.Greaterf(t, f
require/require.go:646
↓ 1 callersFunctionHTTPBodyContains
HTTPBodyContains asserts that a specified handler returns a body that contains a string. require.HTTPBodyContains(t, myHandler, "GET", "www.google.c
require/require.go:662
↓ 1 callersMethodHTTPBodyContains
HTTPBodyContains asserts that a specified handler returns a body that contains a string. a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil,
assert/assertion_forward.go:529
↓ 1 callersFunctionHTTPBodyContainsf
HTTPBodyContainsf asserts that a specified handler returns a body that contains a string. require.HTTPBodyContainsf(t, myHandler, "GET", "www.google
require/require.go:678
↓ 1 callersFunctionHTTPBodyNotContains
HTTPBodyNotContains asserts that a specified handler returns a body that does not contain a string. require.HTTPBodyNotContains(t, myHandler, "GET",
require/require.go:694
↓ 1 callersMethodHTTPBodyNotContains
HTTPBodyNotContains asserts that a specified handler returns a body that does not contain a string. a.HTTPBodyNotContains(myHandler, "GET", "www.goo
assert/assertion_forward.go:555
↓ 1 callersFunctionHTTPBodyNotContainsf
HTTPBodyNotContainsf asserts that a specified handler returns a body that does not contain a string. require.HTTPBodyNotContainsf(t, myHandler, "GET
require/require.go:710
↓ 1 callersFunctionHTTPError
HTTPError asserts that a specified handler returns an error status code. require.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{
require/require.go:725
↓ 1 callersMethodHTTPError
HTTPError asserts that a specified handler returns an error status code. a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}
assert/assertion_forward.go:580
↓ 1 callersFunctionHTTPErrorf
HTTPErrorf asserts that a specified handler returns an error status code. require.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []strin
require/require.go:740
↓ 1 callersFunctionHTTPRedirect
HTTPRedirect asserts that a specified handler returns a redirect status code. require.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []
require/require.go:755
↓ 1 callersMethodHTTPRedirect
HTTPRedirect asserts that a specified handler returns a redirect status code. a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b
assert/assertion_forward.go:604
↓ 1 callersFunctionHTTPRedirectf
HTTPRedirectf asserts that a specified handler returns a redirect status code. require.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a":
require/require.go:770
↓ 1 callersFunctionHTTPStatusCode
HTTPStatusCode asserts that a specified handler returns a specified status code. require.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil,
require/require.go:785
↓ 1 callersFunctionHTTPStatusCodef
HTTPStatusCodef asserts that a specified handler returns a specified status code. require.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", ni
require/require.go:800
↓ 1 callersFunctionHTTPSuccess
HTTPSuccess asserts that a specified handler returns a success status code. require.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
require/require.go:815
↓ 1 callersMethodHTTPSuccess
HTTPSuccess asserts that a specified handler returns a success status code. a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) Returns
assert/assertion_forward.go:652
↓ 1 callersFunctionHTTPSuccessf
HTTPSuccessf asserts that a specified handler returns a success status code. require.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil
require/require.go:830
↓ 1 callersMethodHandleStats
(suiteName string, stats *SuiteInformation)
suite/interfaces.go:53
↓ 1 callersFunctionImplementsf
Implementsf asserts that an object is implemented by the specified interface. require.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error mess
require/require.go:856
↓ 1 callersMethodInDelta
InDelta asserts that the two numerals are within delta of each other. a.InDelta(math.Pi, 22/7.0, 0.01)
assert/assertion_forward.go:694
↓ 1 callersMethodInDelta
InDelta asserts that the two numerals are within delta of each other. a.InDelta(math.Pi, 22/7.0, 0.01)
require/require_forward.go:695
↓ 1 callersFunctionInDeltaMapValues
InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
require/require.go:880
↓ 1 callersFunctionInDeltaMapValuesf
InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
require/require.go:891
↓ 1 callersFunctionInDeltaSlice
InDeltaSlice is the same as InDelta, except it compares two slices.
require/require.go:902
↓ 1 callersFunctionInDeltaSlicef
InDeltaSlicef is the same as InDelta, except it compares two slices.
require/require.go:913
↓ 1 callersFunctionInDeltaf
InDeltaf asserts that the two numerals are within delta of each other. require.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
require/require.go:926
↓ 1 callersFunctionInEpsilon
InEpsilon asserts that expected and actual have a relative error less than epsilon
require/require.go:937
↓ 1 callersMethodInEpsilon
InEpsilon asserts that expected and actual have a relative error less than epsilon
assert/assertion_forward.go:744
↓ 1 callersFunctionInEpsilonSlice
InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
require/require.go:948
↓ 1 callersFunctionInEpsilonSlicef
InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices.
require/require.go:959
↓ 1 callersFunctionInEpsilonf
InEpsilonf asserts that expected and actual have a relative error less than epsilon
require/require.go:970
↓ 1 callersFunctionIsDecreasing
IsDecreasing asserts that the collection is decreasing require.IsDecreasing(t, []int{2, 1, 0}) require.IsDecreasing(t, []float{2, 1}) require.IsDe
require/require.go:985
↓ 1 callersFunctionIsDecreasingf
IsDecreasingf asserts that the collection is decreasing require.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") require.IsDecreas
require/require.go:1000
↓ 1 callersFunctionIsIncreasing
IsIncreasing asserts that the collection is increasing require.IsIncreasing(t, []int{1, 2, 3}) require.IsIncreasing(t, []float{1, 2}) require.IsIn
require/require.go:1015
↓ 1 callersFunctionIsIncreasingf
IsIncreasingf asserts that the collection is increasing require.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") require.IsIncreas
require/require.go:1030
↓ 1 callersMethodIsMethodCallable
IsMethodCallable checking that the method can be called If the method was called more than `Repeatability` return false
mock/mock.go:707
↓ 1 callersFunctionIsNonDecreasing
IsNonDecreasing asserts that the collection is not decreasing require.IsNonDecreasing(t, []int{1, 1, 2}) require.IsNonDecreasing(t, []float{1, 2})
require/require.go:1045
↓ 1 callersFunctionIsNonDecreasingf
IsNonDecreasingf asserts that the collection is not decreasing require.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") require
require/require.go:1060
← previousnext →301–400 of 1,305, ranked by callers