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

Method WithinDuration

assert/assertion_forward.go:1656–1661  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1654//
1655// a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
1656func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
1657 if h, ok := a.t.(tHelper); ok {
1658 h.Helper()
1659 }
1660 return WithinDuration(a.t, expected, actual, delta, msgAndArgs...)
1661}
1662
1663// WithinDurationf asserts that the two times are within duration delta of each other.
1664//

Callers 1

Calls 2

WithinDurationFunction · 0.70
HelperMethod · 0.65

Tested by 1