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

Method InDelta

assert/assertion_forward.go:708–713  ·  view source on GitHub ↗

InDelta asserts that the two numerals are within delta of each other. a.InDelta(math.Pi, 22/7.0, 0.01)

(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

706//
707// a.InDelta(math.Pi, 22/7.0, 0.01)
708func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
709 if h, ok := a.t.(tHelper); ok {
710 h.Helper()
711 }
712 return InDelta(a.t, expected, actual, delta, msgAndArgs...)
713}
714
715// InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
716func (a *Assertions) InDeltaMapValues(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {

Callers 1

TestInDeltaWrapperFunction · 0.45

Calls 2

InDeltaFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestInDeltaWrapperFunction · 0.36