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

Function WithinDuration

internal/testify/require/require.go:1970–1978  ·  view source on GitHub ↗

WithinDuration asserts that the two times are within duration delta of each other. assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)

(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1968//
1969// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
1970func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) {
1971 if h, ok := t.(tHelper); ok {
1972 h.Helper()
1973 }
1974 if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) {
1975 return
1976 }
1977 t.FailNow()
1978}
1979
1980// WithinDurationf asserts that the two times are within duration delta of each other.
1981//

Callers 2

WithinDurationMethod · 0.70
TestWithinDurationFunction · 0.70

Calls 3

WithinDurationFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by 1

TestWithinDurationFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…