MCPcopy
hub / github.com/stretchr/testify / WithinRange

Function WithinRange

require/require.go:2115–2123  ·  view source on GitHub ↗

WithinRange asserts that a time is within a time range (inclusive). require.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))

(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

2113//
2114// require.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
2115func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) {
2116 if h, ok := t.(tHelper); ok {
2117 h.Helper()
2118 }
2119 if assert.WithinRange(t, actual, start, end, msgAndArgs...) {
2120 return
2121 }
2122 t.FailNow()
2123}
2124
2125// WithinRangef asserts that a time is within a time range (inclusive).
2126//

Callers 1

WithinRangeMethod · 0.70

Calls 3

WithinRangeFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected