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

Function WithinDurationf

assert/assertion_format.go:835–840  ·  view source on GitHub ↗

WithinDurationf asserts that the two times are within duration delta of each other. assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")

(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

833//
834// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
835func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
836 if h, ok := t.(tHelper); ok {
837 h.Helper()
838 }
839 return WithinDuration(t, expected, actual, delta, append([]interface{}{msg}, args...)...)
840}
841
842// WithinRangef asserts that a time is within a time range (inclusive).
843//

Callers 2

WithinDurationfFunction · 0.92
WithinDurationfMethod · 0.70

Calls 2

WithinDurationFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected