WithinDuration asserts that the two times are within duration delta of each other. require.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{})
| 2087 | // |
| 2088 | // require.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) |
| 2089 | func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { |
| 2090 | if h, ok := t.(tHelper); ok { |
| 2091 | h.Helper() |
| 2092 | } |
| 2093 | if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { |
| 2094 | return |
| 2095 | } |
| 2096 | t.FailNow() |
| 2097 | } |
| 2098 | |
| 2099 | // WithinDurationf asserts that the two times are within duration delta of each other. |
| 2100 | // |