(t *testing.T)
| 2231 | } |
| 2232 | |
| 2233 | func TestWithinDuration(t *testing.T) { |
| 2234 | t.Parallel() |
| 2235 | |
| 2236 | mockT := new(testing.T) |
| 2237 | a := time.Now() |
| 2238 | b := a.Add(10 * time.Second) |
| 2239 | |
| 2240 | True(t, WithinDuration(mockT, a, b, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 2241 | True(t, WithinDuration(mockT, b, a, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 2242 | |
| 2243 | False(t, WithinDuration(mockT, a, b, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 2244 | False(t, WithinDuration(mockT, b, a, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 2245 | |
| 2246 | False(t, WithinDuration(mockT, a, b, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 2247 | False(t, WithinDuration(mockT, b, a, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 2248 | |
| 2249 | False(t, WithinDuration(mockT, a, b, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 2250 | False(t, WithinDuration(mockT, b, a, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 2251 | } |
| 2252 | |
| 2253 | func TestWithinRange(t *testing.T) { |
| 2254 | t.Parallel() |
nothing calls this directly
no test coverage detected