WithinDurationf asserts that the two times are within duration delta of each other. assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{})
| 1981 | // |
| 1982 | // assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") |
| 1983 | func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { |
| 1984 | if h, ok := t.(tHelper); ok { |
| 1985 | h.Helper() |
| 1986 | } |
| 1987 | if assert.WithinDurationf(t, expected, actual, delta, msg, args...) { |
| 1988 | return |
| 1989 | } |
| 1990 | t.FailNow() |
| 1991 | } |
| 1992 | |
| 1993 | // WithinRange asserts that a time is within a time range (inclusive). |
| 1994 | // |
no test coverage detected
searching dependent graphs…