(t *testing.T)
| 1746 | } |
| 1747 | |
| 1748 | func TestWithinRange(t *testing.T) { |
| 1749 | |
| 1750 | mockT := new(testing.T) |
| 1751 | n := time.Now() |
| 1752 | s := n.Add(-time.Second) |
| 1753 | e := n.Add(time.Second) |
| 1754 | |
| 1755 | True(t, WithinRange(mockT, n, n, n), "Exact same actual, start, and end values return true") |
| 1756 | |
| 1757 | True(t, WithinRange(mockT, n, s, e), "Time in range is within the time range") |
| 1758 | True(t, WithinRange(mockT, s, s, e), "The start time is within the time range") |
| 1759 | True(t, WithinRange(mockT, e, s, e), "The end time is within the time range") |
| 1760 | |
| 1761 | False(t, WithinRange(mockT, s.Add(-time.Nanosecond), s, e, "Just before the start time is not within the time range")) |
| 1762 | False(t, WithinRange(mockT, e.Add(time.Nanosecond), s, e, "Just after the end time is not within the time range")) |
| 1763 | |
| 1764 | False(t, WithinRange(mockT, n, e, s, "Just after the end time is not within the time range")) |
| 1765 | } |
| 1766 | |
| 1767 | func TestInDelta(t *testing.T) { |
| 1768 | mockT := new(testing.T) |
nothing calls this directly
no test coverage detected
searching dependent graphs…