MCPcopy Create free account
hub / github.com/stretchr/testify / WithinDurationf

Function WithinDurationf

assert/assertion_format.go:810–815  ·  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

808//
809// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
810func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
811 if h, ok := t.(tHelper); ok {
812 h.Helper()
813 }
814 return WithinDuration(t, expected, actual, delta, append([]interface{}{msg}, args...)...)
815}
816
817// WithinRangef asserts that a time is within a time range (inclusive).
818//

Callers 2

WithinDurationfFunction · 0.92
WithinDurationfMethod · 0.70

Calls 2

WithinDurationFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected