MCPcopy Create free account

hub / github.com/stretchr/testify / functions

Functions1,305 in github.com/stretchr/testify

↓ 1 callersFunctionIsNonIncreasing
IsNonIncreasing asserts that the collection is not increasing require.IsNonIncreasing(t, []int{2, 1, 1}) require.IsNonIncreasing(t, []float{2, 1})
require/require.go:1075
↓ 1 callersFunctionIsNonIncreasingf
IsNonIncreasingf asserts that the collection is not increasing require.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") require
require/require.go:1090
↓ 1 callersMethodIsType
IsType asserts that the specified objects are of the same type.
assert/assertion_forward.go:872
↓ 1 callersMethodIsType
IsType asserts that the specified objects are of the same type.
require/require_forward.go:873
↓ 1 callersFunctionIsTypef
IsTypef asserts that the specified objects are of the same type.
require/require.go:1112
↓ 1 callersFunctionJSONEqf
JSONEqf asserts that two JSON strings are equivalent. require.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "er
require/require.go:1138
↓ 1 callersFunctionLen
Len asserts that the specified object has specific length. Len also fails if the object has a type that len() not accept. require.Len(t, mySlice, 3)
require/require.go:1152
↓ 1 callersFunctionLenf
Lenf asserts that the specified object has specific length. Lenf also fails if the object has a type that len() not accept. require.Lenf(t, mySlice,
require/require.go:1166
↓ 1 callersFunctionLess
Less asserts that the first element is less than the second require.Less(t, 1, 2) require.Less(t, float64(1), float64(2)) require.Less(t, "a", "b"
require/require.go:1181
↓ 1 callersFunctionLessOrEqual
LessOrEqual asserts that the first element is less than or equal to the second require.LessOrEqual(t, 1, 2) require.LessOrEqual(t, 2, 2) require.L
require/require.go:1197
↓ 1 callersFunctionLessOrEqualf
LessOrEqualf asserts that the first element is less than or equal to the second require.LessOrEqualf(t, 1, 2, "error message %s", "formatted") requ
require/require.go:1213
↓ 1 callersFunctionLessf
Lessf asserts that the first element is less than the second require.Lessf(t, 1, 2, "error message %s", "formatted") require.Lessf(t, float64(1), f
require/require.go:1228
↓ 1 callersMethodMatches
(argument interface{})
mock/mock.go:865
↓ 1 callersMethodMaybe
Maybe allows the method call to be optional. Not calling an optional method will not cause an error while asserting expectations
mock/mock.go:192
↓ 1 callersFunctionNegative
Negative asserts that the specified element is negative require.Negative(t, -1) require.Negative(t, -1.23)
require/require.go:1242
↓ 1 callersFunctionNegativef
Negativef asserts that the specified element is negative require.Negativef(t, -1, "error message %s", "formatted") require.Negativef(t, -1.23, "err
require/require.go:1256
↓ 1 callersFunctionNever
Never asserts that the given condition doesn't satisfy in waitFor time, periodically checking the target function each tick. require.Never(t, func()
require/require.go:1270
↓ 1 callersFunctionNeverf
Neverf asserts that the given condition doesn't satisfy in waitFor time, periodically checking the target function each tick. require.Neverf(t, func
require/require.go:1284
↓ 1 callersMethodNil
Nil asserts that the specified object is nil. a.Nil(err)
assert/assertion_forward.go:1026
↓ 1 callersMethodNil
Nil asserts that the specified object is nil. a.Nil(err)
require/require_forward.go:1027
↓ 1 callersFunctionNilf
Nilf asserts that the specified object is nil. require.Nilf(t, err, "error message %s", "formatted")
require/require.go:1310
↓ 1 callersFunctionNoDirExists
NoDirExists checks whether a directory does not exist in the given path. It fails if the path points to an existing _directory_ only.
require/require.go:1322
↓ 1 callersFunctionNoDirExistsf
NoDirExistsf checks whether a directory does not exist in the given path. It fails if the path points to an existing _directory_ only.
require/require.go:1334
↓ 1 callersMethodNoError
NoError asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if a.NoError(err) { assert.Equal(t, expec
assert/assertion_forward.go:1067
↓ 1 callersMethodNoError
NoError asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if a.NoError(err) { assert.Equal(t, expec
require/require_forward.go:1068
↓ 1 callersFunctionNoErrorf
NoErrorf asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if require.NoErrorf(t, err, "error message %s
require/require.go:1366
↓ 1 callersFunctionNoFileExists
NoFileExists checks whether a file does not exist in a given path. It fails if the path points to an existing _file_ only.
require/require.go:1378
↓ 1 callersFunctionNoFileExistsf
NoFileExistsf checks whether a file does not exist in a given path. It fails if the path points to an existing _file_ only.
require/require.go:1390
↓ 1 callersMethodNotContains
NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element. a.NotContains("Hell
assert/assertion_forward.go:1111
↓ 1 callersMethodNotContains
NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element. a.NotContains("Hell
require/require_forward.go:1112
↓ 1 callersFunctionNotContainsf
NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the specified substring or element. require.NotContain
require/require.go:1422
↓ 1 callersFunctionNotElementsMatch
NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified listB(array, slice...) ignoring the order of the elements
require/require.go:1442
↓ 1 callersFunctionNotElementsMatchf
NotElementsMatchf asserts that the specified listA(array, slice...) is NOT equal to specified listB(array, slice...) ignoring the order of the element
require/require.go:1462
↓ 1 callersMethodNotEmpty
NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either a slice or a channel with len == 0. if a.NotEmpty(obj
assert/assertion_forward.go:1171
↓ 1 callersMethodNotEmpty
NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either a slice or a channel with len == 0. if a.NotEmpty(obj
require/require_forward.go:1172
↓ 1 callersFunctionNotEmptyf
NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either a slice or a channel with len == 0. if require.NotEm
require/require.go:1494
↓ 1 callersMethodNotEqual
NotEqual asserts that the specified values are NOT equal. a.NotEqual(obj1, obj2) Pointer variable equality is determined based on the equality of t
assert/assertion_forward.go:1197
↓ 1 callersFunctionNotEqualValues
NotEqualValues asserts that two objects are not equal even when converted to the same type require.NotEqualValues(t, obj1, obj2)
require/require.go:1523
↓ 1 callersMethodNotEqualValues
NotEqualValues asserts that two objects are not equal even when converted to the same type a.NotEqualValues(obj1, obj2)
assert/assertion_forward.go:1207
↓ 1 callersFunctionNotEqualValuesf
NotEqualValuesf asserts that two objects are not equal even when converted to the same type require.NotEqualValuesf(t, obj1, obj2, "error message %s
require/require.go:1536
↓ 1 callersFunctionNotEqualf
NotEqualf asserts that the specified values are NOT equal. require.NotEqualf(t, obj1, obj2, "error message %s", "formatted") Pointer variable equal
require/require.go:1552
↓ 1 callersFunctionNotErrorAs
NotErrorAs asserts that none of the errors in err's chain matches target, but if so, sets target to that error value.
require/require.go:1564
↓ 1 callersFunctionNotErrorAsf
NotErrorAsf asserts that none of the errors in err's chain matches target, but if so, sets target to that error value.
require/require.go:1576
↓ 1 callersFunctionNotErrorIs
NotErrorIs asserts that none of the errors in err's chain matches target. This is a wrapper for errors.Is.
require/require.go:1588
↓ 1 callersFunctionNotErrorIsf
NotErrorIsf asserts that none of the errors in err's chain matches target. This is a wrapper for errors.Is.
require/require.go:1600
↓ 1 callersFunctionNotImplements
NotImplements asserts that an object does not implement the specified interface. require.NotImplements(t, (*MyInterface)(nil), new(MyObject))
require/require.go:1613
↓ 1 callersFunctionNotImplementsf
NotImplementsf asserts that an object does not implement the specified interface. require.NotImplementsf(t, (*MyInterface)(nil), new(MyObject), "err
require/require.go:1626
↓ 1 callersMethodNotNil
NotNil asserts that the specified object is not nil. a.NotNil(err)
assert/assertion_forward.go:1296
↓ 1 callersMethodNotNil
NotNil asserts that the specified object is not nil. a.NotNil(err)
require/require_forward.go:1297
↓ 1 callersFunctionNotNilf
NotNilf asserts that the specified object is not nil. require.NotNilf(t, err, "error message %s", "formatted")
require/require.go:1652
↓ 1 callersMethodNotPanics
NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. a.NotPanics(func(){ RemainCalm() })
assert/assertion_forward.go:1316
↓ 1 callersMethodNotPanics
NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. a.NotPanics(func(){ RemainCalm() })
require/require_forward.go:1317
↓ 1 callersFunctionNotPanicsf
NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. require.NotPanicsf(t, func(){ RemainCalm() }, "error message %s"
require/require.go:1678
↓ 1 callersFunctionNotRegexp
NotRegexp asserts that a specified regexp does not match a string. require.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") require.NotR
require/require.go:1692
↓ 1 callersMethodNotRegexp
NotRegexp asserts that a specified regexp does not match a string. a.NotRegexp(regexp.MustCompile("starts"), "it's starting") a.NotRegexp("^start",
assert/assertion_forward.go:1337
↓ 1 callersFunctionNotRegexpf
NotRegexpf asserts that a specified regexp does not match a string. require.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error mess
require/require.go:1706
↓ 1 callersFunctionNotSame
NotSame asserts that two pointers do not reference the same object. require.NotSame(t, ptr1, ptr2) Both arguments must be pointer variables. Pointe
require/require.go:1722
↓ 1 callersFunctionNotSamef
NotSamef asserts that two pointers do not reference the same object. require.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") Both argument
require/require.go:1738
↓ 1 callersFunctionNotSubset
NotSubset asserts that the specified list(array, slice...) or map does NOT contain all elements given in the specified subset list(array, slice...) or
require/require.go:1754
↓ 1 callersFunctionNotSubsetf
NotSubsetf asserts that the specified list(array, slice...) or map does NOT contain all elements given in the specified subset list(array, slice...) o
require/require.go:1770
↓ 1 callersMethodNotZero
NotZero asserts that i is not the zero value for its type.
assert/assertion_forward.go:1408
↓ 1 callersMethodNotZero
NotZero asserts that i is not the zero value for its type.
require/require_forward.go:1409
↓ 1 callersFunctionNotZerof
NotZerof asserts that i is not the zero value for its type.
require/require.go:1792
↓ 1 callersFunctionObjectsExportedFieldsAreEqual
ObjectsExportedFieldsAreEqual determines if the exported (public) fields of two objects are considered equal. This comparison of only exported fields
assert/assertions.go:156
↓ 1 callersMethodOn
On starts a description of an expectation of the specified method being called. Mock.On("MyMethod", arg1, arg2)
mock/mock.go:359
↓ 1 callersFunctionOpBytes
(b []byte)
mock/mock_test.go:54
↓ 1 callersMethodPanics
Panics asserts that the code inside the specified PanicTestFunc panics. a.Panics(func(){ GoCrazy() })
assert/assertion_forward.go:1426
↓ 1 callersMethodPanics
Panics asserts that the code inside the specified PanicTestFunc panics. a.Panics(func(){ GoCrazy() })
require/require_forward.go:1427
↓ 1 callersFunctionPanicsWithError
PanicsWithError asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the Equ
require/require.go:1820
↓ 1 callersFunctionPanicsWithErrorf
PanicsWithErrorf asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the Eq
require/require.go:1835
↓ 1 callersFunctionPanicsWithValuef
PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value equals the expected panic value.
require/require.go:1863
↓ 1 callersFunctionPanicsf
Panicsf asserts that the code inside the specified PanicTestFunc panics. require.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
require/require.go:1876
↓ 1 callersFunctionPositive
Positive asserts that the specified element is positive require.Positive(t, 1) require.Positive(t, 1.23)
require/require.go:1890
↓ 1 callersFunctionPositivef
Positivef asserts that the specified element is positive require.Positivef(t, 1, "error message %s", "formatted") require.Positivef(t, 1.23, "error
require/require.go:1904
↓ 1 callersFunctionRegexp
Regexp asserts that a specified regexp matches a string. require.Regexp(t, regexp.MustCompile("start"), "it's starting") require.Regexp(t, "start..
require/require.go:1918
↓ 1 callersMethodRegexp
Regexp asserts that a specified regexp matches a string. a.Regexp(regexp.MustCompile("start"), "it's starting") a.Regexp("start...$", "it's not sta
assert/assertion_forward.go:1515
↓ 1 callersFunctionRegexpf
Regexpf asserts that a specified regexp matches a string. require.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "form
require/require.go:1932
↓ 1 callersFunctionSame
Same asserts that two pointers reference the same object. require.Same(t, ptr1, ptr2) Both arguments must be pointer variables. Pointer variable sa
require/require.go:1948
↓ 1 callersFunctionSamef
Samef asserts that two pointers reference the same object. require.Samef(t, ptr1, ptr2, "error message %s", "formatted") Both arguments must be poi
require/require.go:1964
↓ 1 callersMethodSetS
(suite TestingSuite)
suite/interfaces.go:10
↓ 1 callersMethodSetT
SetT sets the current *testing.T context.
suite/suite.go:42
↓ 1 callersMethodSetupSubTest
()
suite/interfaces.go:59
↓ 1 callersMethodSetupSuite
()
suite/interfaces.go:16
↓ 1 callersMethodSetupTest
()
suite/interfaces.go:22
↓ 1 callersMethodStartCapture
()
suite/suite_test.go:432
↓ 1 callersMethodStopCapture
()
suite/suite_test.go:437
↓ 1 callersFunctionSubset
Subset asserts that the specified list(array, slice...) or map contains all elements given in the specified subset list(array, slice...) or map. req
require/require.go:1979
↓ 1 callersFunctionSubsetf
Subsetf asserts that the specified list(array, slice...) or map contains all elements given in the specified subset list(array, slice...) or map. re
require/require.go:1994
↓ 1 callersMethodT
T retrieves the current *testing.T context.
suite/suite.go:35
↓ 1 callersMethodTearDownSubTest
()
suite/interfaces.go:65
↓ 1 callersMethodTearDownSuite
()
suite/interfaces.go:28
↓ 1 callersMethodTearDownTest
()
suite/interfaces.go:34
↓ 1 callersMethodTest
* Setting expectations */ Test sets the test struct variable of the mock object
mock/mock.go:335
↓ 1 callersMethodTestData
TestData holds any data that might be useful for testing. Testify ignores this data completely allowing you to do whatever you like with it.
mock/mock.go:322
↓ 1 callersMethodTheExampleMethod
(a, b, c int)
mock/mock_test.go:30
↓ 1 callersMethodTheExampleMethod4
(v ExampleInterface)
mock/mock_test.go:83
↓ 1 callersMethodTheExampleMethod5
(ch chan struct{})
mock/mock_test.go:88
↓ 1 callersMethodTheExampleMethod6
(m map[string]bool)
mock/mock_test.go:93
↓ 1 callersFunctionTheExampleMethodFunctionalOptionsIndirect
(i *TestExampleImplementation)
mock/mock_test.go:65
↓ 1 callersMethodTheExampleMethodMixedVariadic
(a int, b ...int)
mock/mock_test.go:118
← previousnext →401–500 of 1,305, ranked by callers