MCPcopy
hub / github.com/expr-lang/expr / TestWithinRange

Function TestWithinRange

internal/testify/assert/assertions_test.go:1748–1765  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1746}
1747
1748func 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
1767func TestInDelta(t *testing.T) {
1768 mockT := new(testing.T)

Callers

nothing calls this directly

Calls 4

TrueFunction · 0.70
WithinRangeFunction · 0.70
FalseFunction · 0.70
AddMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…