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

Method WithinDuration

require/require_forward.go:1657–1662  ·  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

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

Callers 1

Calls 2

WithinDurationFunction · 0.70
HelperMethod · 0.65

Tested by 1