(t *testing.T)
| 2251 | } |
| 2252 | |
| 2253 | func TestWithinRange(t *testing.T) { |
| 2254 | t.Parallel() |
| 2255 | |
| 2256 | mockT := new(testing.T) |
| 2257 | n := time.Now() |
| 2258 | s := n.Add(-time.Second) |
| 2259 | e := n.Add(time.Second) |
| 2260 | |
| 2261 | True(t, WithinRange(mockT, n, n, n), "Exact same actual, start, and end values return true") |
| 2262 | |
| 2263 | True(t, WithinRange(mockT, n, s, e), "Time in range is within the time range") |
| 2264 | True(t, WithinRange(mockT, s, s, e), "The start time is within the time range") |
| 2265 | True(t, WithinRange(mockT, e, s, e), "The end time is within the time range") |
| 2266 | |
| 2267 | False(t, WithinRange(mockT, s.Add(-time.Nanosecond), s, e, "Just before the start time is not within the time range")) |
| 2268 | False(t, WithinRange(mockT, e.Add(time.Nanosecond), s, e, "Just after the end time is not within the time range")) |
| 2269 | |
| 2270 | False(t, WithinRange(mockT, n, e, s, "Just after the end time is not within the time range")) |
| 2271 | } |
| 2272 | |
| 2273 | func TestInDelta(t *testing.T) { |
| 2274 | t.Parallel() |
nothing calls this directly
no test coverage detected