MCPcopy
hub / github.com/stretchr/testify / TestClosestCallMismatchedArgumentValueInformation

Function TestClosestCallMismatchedArgumentValueInformation

mock/mock_test.go:2324–2338  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2322}
2323
2324func TestClosestCallMismatchedArgumentValueInformation(t *testing.T) {
2325 t.Parallel()
2326
2327 defer func() {
2328 if r := recover(); r != nil {
2329 matchingExp := regexp.MustCompile(unexpectedCallRegex(`GetTime(int)`, "0: 1", "0: 999", `Diff: 0: FAIL: \(int=1\) != \(int=999\)`))
2330 assert.Regexp(t, matchingExp, r)
2331 }
2332 }()
2333
2334 m := new(timer)
2335 m.On("GetTime", 999).Return("SomeTime").Once()
2336
2337 _ = m.GetTime(1)
2338}
2339
2340func Test_isBetterMatchThanReturnsFalseIfCandidateCallIsNil(t *testing.T) {
2341 t.Parallel()

Callers

nothing calls this directly

Calls 6

RegexpFunction · 0.92
unexpectedCallRegexFunction · 0.85
OnceMethod · 0.80
ReturnMethod · 0.80
GetTimeMethod · 0.80
OnMethod · 0.45

Tested by

no test coverage detected