WithinDuration asserts that the two times are within duration delta of each other. assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{})
| 1968 | // |
| 1969 | // assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) |
| 1970 | func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { |
| 1971 | if h, ok := t.(tHelper); ok { |
| 1972 | h.Helper() |
| 1973 | } |
| 1974 | if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { |
| 1975 | return |
| 1976 | } |
| 1977 | t.FailNow() |
| 1978 | } |
| 1979 | |
| 1980 | // WithinDurationf asserts that the two times are within duration delta of each other. |
| 1981 | // |
searching dependent graphs…