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

Function InDeltaf

assert/assertion_format.go:361–366  ·  view source on GitHub ↗

InDeltaf asserts that the two numerals are within delta of each other. assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")

(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

359//
360// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
361func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
362 if h, ok := t.(tHelper); ok {
363 h.Helper()
364 }
365 return InDelta(t, expected, actual, delta, append([]interface{}{msg}, args...)...)
366}
367
368// InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
369func InDeltaMapValuesf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {

Callers 2

InDeltafFunction · 0.92
InDeltafMethod · 0.70

Calls 2

InDeltaFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected