WithinRange asserts that a time is within a time range (inclusive). require.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{})
| 2113 | // |
| 2114 | // require.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) |
| 2115 | func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) { |
| 2116 | if h, ok := t.(tHelper); ok { |
| 2117 | h.Helper() |
| 2118 | } |
| 2119 | if assert.WithinRange(t, actual, start, end, msgAndArgs...) { |
| 2120 | return |
| 2121 | } |
| 2122 | t.FailNow() |
| 2123 | } |
| 2124 | |
| 2125 | // WithinRangef asserts that a time is within a time range (inclusive). |
| 2126 | // |
no test coverage detected