InDelta asserts that the two numerals are within delta of each other. require.InDelta(t, math.Pi, 22/7.0, 0.01)
(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{})
| 881 | // |
| 882 | // require.InDelta(t, math.Pi, 22/7.0, 0.01) |
| 883 | func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { |
| 884 | if h, ok := t.(tHelper); ok { |
| 885 | h.Helper() |
| 886 | } |
| 887 | if assert.InDelta(t, expected, actual, delta, msgAndArgs...) { |
| 888 | return |
| 889 | } |
| 890 | t.FailNow() |
| 891 | } |
| 892 | |
| 893 | // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. |
| 894 | func InDeltaMapValues(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { |