MCPcopy Index your code
hub / github.com/expr-lang/expr / InDelta

Function InDelta

internal/testify/require/require.go:870–878  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

868//
869// assert.InDelta(t, math.Pi, 22/7.0, 0.01)
870func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
871 if h, ok := t.(tHelper); ok {
872 h.Helper()
873 }
874 if assert.InDelta(t, expected, actual, delta, msgAndArgs...) {
875 return
876 }
877 t.FailNow()
878}
879
880// InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
881func InDeltaMapValues(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {

Callers 2

InDeltaMethod · 0.70
TestInDeltaFunction · 0.70

Calls 3

InDeltaFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by 1

TestInDeltaFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…