MCPcopy Create free account

hub / github.com/stretchr/testify / functions

Functions1,305 in github.com/stretchr/testify

↓ 1 callersMethodTheExampleMethodVariadic
(a ...int)
mock/mock_test.go:108
↓ 1 callersFunctionTruef
Truef asserts that the specified value is true. require.Truef(t, myBool, "error message %s", "formatted")
require/require.go:2020
↓ 1 callersFunctionUnmarshal
Unmarshal is just a wrapper of [gopkg.in/yaml.v3.Unmarshal].
assert/yaml/yaml_default.go:35
↓ 1 callersMethodUse
(c caller)
mock/mock_test.go:2254
↓ 1 callersMethodWithinDuration
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 callersMethodWithinDuration
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 callersFunctionWithinDurationf
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 callersFunctionWithinRange
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 callersFunctionWithinRangef
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 callersFunctionYAMLEqf
YAMLEqf asserts that two YAML strings are equivalent.
require/require.go:2094
↓ 1 callersMethodZero
Zero asserts that i is the zero value for its type.
require/require_forward.go:1661
↓ 1 callersFunctionZerof
Zerof asserts that i is the zero value for its type.
require/require.go:2116
↓ 1 callersFunctionanalyzeCode
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 callersFunctionassertOpts
(expected, actual interface{})
mock/mock.go:1204
↓ 1 callersFunctionasyncCall
(m *Mock, ch chan Arguments)
mock/mock_test.go:1262
↓ 1 callersFunctioncalcRelativeError
(expected, actual interface{})
assert/assertions.go:1495
↓ 1 callersFunctioncallOrderAssert
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 callersFunctioncallerName
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 callersFunctiondiff
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 callersFunctiondiffArguments
(expected Arguments, actual Arguments)
mock/mock.go:1145
↓ 1 callersMethodend
(testName string, passed bool)
suite/stats.go:33
↓ 1 callersMethodfail
()
assert/assertions.go:1988
↓ 1 callersMethodfindClosestCall
(method string, arguments ...interface{})
mock/mock.go:423
↓ 1 callersFunctionformatListDiff
(listA, listB interface{}, extraA, extraB []interface{})
assert/assertions.go:1158
↓ 1 callersFunctionfuncName
(f *runtime.Func)
mock/mock.go:1271
↓ 1 callersFunctiongenerateCode
(importer imports.Importer, funcs []testFunc)
_codegen/main.go:56
↓ 1 callersFunctionindentMessageLines
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 callersFunctionisFuncSame
(f1, f2 *runtime.Func)
mock/mock.go:1283
↓ 1 callersFunctionisFunction
(arg interface{})
assert/assertions.go:1898
↓ 1 callersFunctionisNumericType
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 callersFunctionisTest
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 callersFunctionlabeledOutput
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 callersFunctionmessageFromMsgAndArgs
(msgAndArgs ...interface{})
assert/assertions.go:286
↓ 1 callersFunctionmethodFilter
Filtering method according to set regular expression specified command-line argument -m
suite/suite.go:225
↓ 1 callersFunctionoutputFile
()
_codegen/main.go:119
↓ 1 callersFunctionparseLabeledOutput
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 callersFunctionparsePackageSource
parsePackageSource returns the types scope and the package documentation from the package
_codegen/main.go:176
↓ 1 callersFunctionparseTemplates
()
_codegen/main.go:98
↓ 1 callersFunctionrunTests
(t testing.TB, tests []testing.InternalTest)
suite/suite.go:232
↓ 1 callersFunctionruntimeFunc
(opt interface{})
mock/mock.go:1267
↓ 1 callersMethodstart
(testName string)
suite/stats.go:26
↓ 1 callersFunctiontestAutogeneratedFunction
()
assert/assertions_test.go:2130
↓ 1 callersFunctiontypeAndKind
(v interface{})
mock/mock.go:1134
↓ 1 callersFunctiontypeAndKind
(v interface{})
assert/assertions.go:1842
MethodAfterTest
(_, _ string)
suite/suite_test.go:85
MethodAfterTest
(suiteName, testName string)
suite/suite_test.go:190
MethodAssertExpectations
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
MethodBeforeTest
(_, _ string)
suite/suite_test.go:73
MethodBeforeTest
(suiteName, testName string)
suite/suite_test.go:184
FunctionBenchmarkBytesEqual
(b *testing.B)
assert/assertions_test.go:2702
FunctionBenchmarkNotNil
(b *testing.B)
assert/assertions_test.go:2718
MethodCommentFormat
()
_codegen/main.go:288
MethodCommentWithoutT
(receiver string)
_codegen/main.go:296
MethodCondition
Condition uses a Comparison to assert a complex condition.
require/require_forward.go:13
MethodConditionf
Conditionf uses a Comparison to assert a complex condition.
assert/assertion_forward.go:20
MethodConditionf
Conditionf uses a Comparison to assert a complex condition.
require/require_forward.go:21
MethodContainsf
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
MethodContainsf
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
MethodDirExists
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
MethodDirExists
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
MethodDirExistsf
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
MethodDirExistsf
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
MethodElementsMatch
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
MethodElementsMatch
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
MethodElementsMatchf
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
MethodElementsMatchf
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
MethodEmptyf
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
MethodEmptyf
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
MethodEqualErrorf
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
MethodEqualErrorf
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
MethodEqualExportedValues
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
MethodEqualExportedValues
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
MethodEqualExportedValuesf
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
MethodEqualExportedValuesf
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
MethodEqualValues
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
MethodEqualValuesf
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
MethodEqualValuesf
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
MethodEqualf
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
MethodEqualf
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
MethodError
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
MethodErrorAs
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
MethodErrorAs
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
MethodErrorAsf
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
MethodErrorAsf
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
MethodErrorContainsf
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
MethodErrorContainsf
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
MethodErrorIs
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
MethodErrorIs
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
MethodErrorIsf
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
MethodErrorIsf
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
MethodErrorf
(format string, args ...interface{})
mock/mock.go:27
MethodErrorf
(string, ...interface{})
mock/mock_test.go:141
MethodErrorf
(format string, args ...interface{})
mock/mock_test.go:2041
MethodErrorf
(format string, args ...interface{})
assert/assertions_test.go:721
MethodErrorf
(format string, args ...interface{})
assert/assertions_test.go:2657
MethodErrorf
(format string, args ...interface{})
assert/assertions_test.go:2677
MethodErrorf
(format string, args ...interface{})
assert/assertions_test.go:2984
MethodErrorf
(format string, args ...interface{})
assert/assertions_test.go:3181
MethodErrorf
(format string, args ...interface{})
assert/assertions.go:31
MethodErrorf
Errorf collects the error.
assert/assertions.go:1968
← previousnext →501–600 of 1,305, ranked by callers