(t *testing.T)
| 1727 | } |
| 1728 | |
| 1729 | func TestWithinDuration(t *testing.T) { |
| 1730 | |
| 1731 | mockT := new(testing.T) |
| 1732 | a := time.Now() |
| 1733 | b := a.Add(10 * time.Second) |
| 1734 | |
| 1735 | True(t, WithinDuration(mockT, a, b, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 1736 | True(t, WithinDuration(mockT, b, a, 10*time.Second), "A 10s difference is within a 10s time difference") |
| 1737 | |
| 1738 | False(t, WithinDuration(mockT, a, b, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1739 | False(t, WithinDuration(mockT, b, a, 9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1740 | |
| 1741 | False(t, WithinDuration(mockT, a, b, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1742 | False(t, WithinDuration(mockT, b, a, -9*time.Second), "A 10s difference is not within a 9s time difference") |
| 1743 | |
| 1744 | False(t, WithinDuration(mockT, a, b, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 1745 | False(t, WithinDuration(mockT, b, a, -11*time.Second), "A 10s difference is not within a 9s time difference") |
| 1746 | } |
| 1747 | |
| 1748 | func TestWithinRange(t *testing.T) { |
| 1749 |
nothing calls this directly
no test coverage detected
searching dependent graphs…