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

Method WithinDurationf

assert/assertion_forward.go:1666–1671  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1664//
1665// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
1666func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
1667 if h, ok := a.t.(tHelper); ok {
1668 h.Helper()
1669 }
1670 return WithinDurationf(a.t, expected, actual, delta, msg, args...)
1671}
1672
1673// WithinRange asserts that a time is within a time range (inclusive).
1674//

Callers

nothing calls this directly

Calls 2

WithinDurationfFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected