Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/stretchr/testify
/ functions
Functions
1,305 in github.com/stretchr/testify
⨍
Functions
1,305
◇
Types & classes
122
↓ 1 callers
Method
TheExampleMethodVariadic
(a ...int)
mock/mock_test.go:108
↓ 1 callers
Function
Truef
Truef asserts that the specified value is true. require.Truef(t, myBool, "error message %s", "formatted")
require/require.go:2020
↓ 1 callers
Function
Unmarshal
Unmarshal is just a wrapper of [gopkg.in/yaml.v3.Unmarshal].
assert/yaml/yaml_default.go:35
↓ 1 callers
Method
Use
(c caller)
mock/mock_test.go:2254
↓ 1 callers
Method
WithinDuration
WithinDuration asserts that the two times are within duration delta of each other. a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
assert/assertion_forward.go:1606
↓ 1 callers
Method
WithinDuration
WithinDuration asserts that the two times are within duration delta of each other. a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
require/require_forward.go:1607
↓ 1 callers
Function
WithinDurationf
WithinDurationf asserts that the two times are within duration delta of each other. require.WithinDurationf(t, time.Now(), time.Now(), 10*time.Secon
require/require.go:2046
↓ 1 callers
Function
WithinRange
WithinRange asserts that a time is within a time range (inclusive). require.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(
require/require.go:2059
↓ 1 callers
Function
WithinRangef
WithinRangef asserts that a time is within a time range (inclusive). require.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Ad
require/require.go:2072
↓ 1 callers
Function
YAMLEqf
YAMLEqf asserts that two YAML strings are equivalent.
require/require.go:2094
↓ 1 callers
Method
Zero
Zero asserts that i is the zero value for its type.
require/require_forward.go:1661
↓ 1 callers
Function
Zerof
Zerof asserts that i is the zero value for its type.
require/require.go:2116
↓ 1 callers
Function
analyzeCode
analyzeCode takes the types scope and the docs and returns the import information and information about all the assertion functions.
_codegen/main.go:132
↓ 1 callers
Function
assertOpts
(expected, actual interface{})
mock/mock.go:1204
↓ 1 callers
Function
asyncCall
(m *Mock, ch chan Arguments)
mock/mock_test.go:1262
↓ 1 callers
Function
calcRelativeError
(expected, actual interface{})
assert/assertions.go:1495
↓ 1 callers
Function
callOrderAssert
callOrderAssert is a help with confirms that asserts that expect matches one or more times in callOrder. This makes it compatible with go test flag -c
suite/suite_test.go:625
↓ 1 callers
Function
callerName
callerName gives the function name (qualified with a package path) for the caller after skip frames (where 0 means the current function).
assert/assertion_compare_test.go:117
↓ 1 callers
Function
diff
diff returns a diff of both values as long as both are of the same type and are a struct, map, slice or array. Otherwise it returns an empty string.
mock/mock.go:1161
↓ 1 callers
Function
diffArguments
(expected Arguments, actual Arguments)
mock/mock.go:1145
↓ 1 callers
Method
end
(testName string, passed bool)
suite/stats.go:33
↓ 1 callers
Method
fail
()
assert/assertions.go:1988
↓ 1 callers
Method
findClosestCall
(method string, arguments ...interface{})
mock/mock.go:423
↓ 1 callers
Function
formatListDiff
(listA, listB interface{}, extraA, extraB []interface{})
assert/assertions.go:1158
↓ 1 callers
Function
funcName
(f *runtime.Func)
mock/mock.go:1271
↓ 1 callers
Function
generateCode
(importer imports.Importer, funcs []testFunc)
_codegen/main.go:56
↓ 1 callers
Function
indentMessageLines
Aligns the provided message so that all lines after the first line start at the same location as the first line. Assumes that the first line starts at
assert/assertions.go:307
↓ 1 callers
Function
isFuncSame
(f1, f2 *runtime.Func)
mock/mock.go:1283
↓ 1 callers
Function
isFunction
(arg interface{})
assert/assertions.go:1898
↓ 1 callers
Function
isNumericType
isNumericType returns true if the type is one of: int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64, complex64, co
assert/assertions.go:201
↓ 1 callers
Function
isTest
Stolen from the `go test` tool. isTest tells whether name looks like a test (or benchmark, according to prefix). It is a Test (say) if there is a char
assert/assertions.go:275
↓ 1 callers
Function
labeledOutput
labeledOutput returns a string consisting of the provided labeledContent. Each labeled output is appended in the following manner: \t{{label}}:{{ali
assert/assertions.go:388
↓ 1 callers
Function
messageFromMsgAndArgs
(msgAndArgs ...interface{})
assert/assertions.go:286
↓ 1 callers
Function
methodFilter
Filtering method according to set regular expression specified command-line argument -m
suite/suite.go:225
↓ 1 callers
Function
outputFile
()
_codegen/main.go:119
↓ 1 callers
Function
parseLabeledOutput
parseLabeledOutput does the inverse of labeledOutput - it takes a formatted output string and turns it back into a slice of labeledContent.
assert/assertions_test.go:3142
↓ 1 callers
Function
parsePackageSource
parsePackageSource returns the types scope and the package documentation from the package
_codegen/main.go:176
↓ 1 callers
Function
parseTemplates
()
_codegen/main.go:98
↓ 1 callers
Function
runTests
(t testing.TB, tests []testing.InternalTest)
suite/suite.go:232
↓ 1 callers
Function
runtimeFunc
(opt interface{})
mock/mock.go:1267
↓ 1 callers
Method
start
(testName string)
suite/stats.go:26
↓ 1 callers
Function
testAutogeneratedFunction
()
assert/assertions_test.go:2130
↓ 1 callers
Function
typeAndKind
(v interface{})
mock/mock.go:1134
↓ 1 callers
Function
typeAndKind
(v interface{})
assert/assertions.go:1842
Method
AfterTest
(_, _ string)
suite/suite_test.go:85
Method
AfterTest
(suiteName, testName string)
suite/suite_test.go:190
Method
AssertExpectations
AssertExpectations asserts that everything specified with On and Return was in fact called as expected. Calls may have occurred in any order.
mock/mock.go:612
Method
BeforeTest
(_, _ string)
suite/suite_test.go:73
Method
BeforeTest
(suiteName, testName string)
suite/suite_test.go:184
Function
BenchmarkBytesEqual
(b *testing.B)
assert/assertions_test.go:2702
Function
BenchmarkNotNil
(b *testing.B)
assert/assertions_test.go:2718
Method
CommentFormat
()
_codegen/main.go:288
Method
CommentWithoutT
(receiver string)
_codegen/main.go:296
Method
Condition
Condition uses a Comparison to assert a complex condition.
require/require_forward.go:13
Method
Conditionf
Conditionf uses a Comparison to assert a complex condition.
assert/assertion_forward.go:20
Method
Conditionf
Conditionf uses a Comparison to assert a complex condition.
require/require_forward.go:21
Method
Containsf
Containsf asserts that the specified string, list(array, slice...) or map contains the specified substring or element. a.Containsf("Hello World", "W
assert/assertion_forward.go:46
Method
Containsf
Containsf asserts that the specified string, list(array, slice...) or map contains the specified substring or element. a.Containsf("Hello World", "W
require/require_forward.go:47
Method
DirExists
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
assert/assertion_forward.go:55
Method
DirExists
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_forward.go:56
Method
DirExistsf
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
assert/assertion_forward.go:64
Method
DirExistsf
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_forward.go:65
Method
ElementsMatch
ElementsMatch asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements. If th
assert/assertion_forward.go:76
Method
ElementsMatch
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_forward.go:77
Method
ElementsMatchf
ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements. If t
assert/assertion_forward.go:88
Method
ElementsMatchf
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_forward.go:89
Method
Emptyf
Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. a.Emptyf(obj, "error messag
assert/assertion_forward.go:110
Method
Emptyf
Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. a.Emptyf(obj, "error messag
require/require_forward.go:111
Method
EqualErrorf
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/assertion_forward.go:148
Method
EqualErrorf
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_forward.go:149
Method
EqualExportedValues
EqualExportedValues asserts that the types of two objects are equal and their public fields are also equal. This is useful for comparing structs that
assert/assertion_forward.go:165
Method
EqualExportedValues
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_forward.go:166
Method
EqualExportedValuesf
EqualExportedValuesf asserts that the types of two objects are equal and their public fields are also equal. This is useful for comparing structs that
assert/assertion_forward.go:182
Method
EqualExportedValuesf
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_forward.go:183
Method
EqualValues
EqualValues asserts that two objects are equal or convertible to the larger type and equal. a.EqualValues(uint32(123), int32(123))
require/require_forward.go:194
Method
EqualValuesf
EqualValuesf asserts that two objects are equal or convertible to the larger type and equal. a.EqualValuesf(uint32(123), int32(123), "error message
assert/assertion_forward.go:204
Method
EqualValuesf
EqualValuesf asserts that two objects are equal or convertible to the larger type and equal. a.EqualValuesf(uint32(123), int32(123), "error message
require/require_forward.go:205
Method
Equalf
Equalf asserts that two objects are equal. a.Equalf(123, 123, "error message %s", "formatted") Pointer variable equality is determined based on the
assert/assertion_forward.go:218
Method
Equalf
Equalf asserts that two objects are equal. a.Equalf(123, 123, "error message %s", "formatted") Pointer variable equality is determined based on the
require/require_forward.go:219
Method
Error
Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if a.Error(err) { assert.Equal(t, expec
assert/assertion_forward.go:231
Method
ErrorAs
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
assert/assertion_forward.go:240
Method
ErrorAs
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_forward.go:241
Method
ErrorAsf
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
assert/assertion_forward.go:249
Method
ErrorAsf
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_forward.go:250
Method
ErrorContainsf
ErrorContainsf asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := Som
assert/assertion_forward.go:273
Method
ErrorContainsf
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_forward.go:274
Method
ErrorIs
ErrorIs asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
assert/assertion_forward.go:282
Method
ErrorIs
ErrorIs asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
require/require_forward.go:283
Method
ErrorIsf
ErrorIsf asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
assert/assertion_forward.go:291
Method
ErrorIsf
ErrorIsf asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
require/require_forward.go:292
Method
Errorf
(format string, args ...interface{})
mock/mock.go:27
Method
Errorf
(string, ...interface{})
mock/mock_test.go:141
Method
Errorf
(format string, args ...interface{})
mock/mock_test.go:2041
Method
Errorf
(format string, args ...interface{})
assert/assertions_test.go:721
Method
Errorf
(format string, args ...interface{})
assert/assertions_test.go:2657
Method
Errorf
(format string, args ...interface{})
assert/assertions_test.go:2677
Method
Errorf
(format string, args ...interface{})
assert/assertions_test.go:2984
Method
Errorf
(format string, args ...interface{})
assert/assertions_test.go:3181
Method
Errorf
(format string, args ...interface{})
assert/assertions.go:31
Method
Errorf
Errorf collects the error.
assert/assertions.go:1968
← previous
next →
501–600 of 1,305, ranked by callers