(t *testing.T)
| 2185 | func (tc *tCustomLogger) FailNow() {} |
| 2186 | |
| 2187 | func TestLoggingAssertExpectations(t *testing.T) { |
| 2188 | t.Parallel() |
| 2189 | |
| 2190 | m := new(timer) |
| 2191 | m.On("GetTime", 0).Return("") |
| 2192 | tcl := &tCustomLogger{t, []string{}, []string{}} |
| 2193 | |
| 2194 | AssertExpectationsForObjects(tcl, m, new(TestExampleImplementation)) |
| 2195 | |
| 2196 | require.Equal(t, 1, len(tcl.errs)) |
| 2197 | assert.Regexp(t, regexp.MustCompile("(?s)FAIL: 0 out of 1 expectation\\(s\\) were met.*The code you are testing needs to make 1 more call\\(s\\).*"), tcl.errs[0]) |
| 2198 | require.Equal(t, 2, len(tcl.logs)) |
| 2199 | assert.Regexp(t, regexp.MustCompile("(?s)FAIL:\tGetTime\\(int\\).*"), tcl.logs[0]) |
| 2200 | require.Equal(t, "Expectations didn't match for Mock: *mock.timer", tcl.logs[1]) |
| 2201 | } |
| 2202 | |
| 2203 | func TestAfterTotalWaitTimeWhileExecution(t *testing.T) { |
| 2204 | t.Parallel() |
nothing calls this directly
no test coverage detected