(t *testing.T)
| 1843 | } |
| 1844 | |
| 1845 | func TestWithinDuration(t *testing.T) { |
| 1846 | |
| 1847 | mockT := new(testing.T) |
| 1848 | a := time.Now() |
| 1849 | b := a.Add(10 * time.Second) |
| 1850 | |
| 1851 | True(t, WithinDuration(mockT, a, b, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 1852 | True(t, WithinDuration(mockT, b, a, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 1853 | |
| 1854 | False(t, WithinDuration(mockT, a, b, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1855 | False(t, WithinDuration(mockT, b, a, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1856 | |
| 1857 | False(t, WithinDuration(mockT, a, b, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1858 | False(t, WithinDuration(mockT, b, a, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1859 | |
| 1860 | False(t, WithinDuration(mockT, a, b, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 1861 | False(t, WithinDuration(mockT, b, a, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 1862 | } |
| 1863 | |
| 1864 | func TestWithinRange(t *testing.T) { |
| 1865 |
nothing calls this directly
no test coverage detected