InDeltaf asserts that the two numerals are within delta of each other. require.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{})
| 938 | // |
| 939 | // require.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") |
| 940 | func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { |
| 941 | if h, ok := t.(tHelper); ok { |
| 942 | h.Helper() |
| 943 | } |
| 944 | if assert.InDeltaf(t, expected, actual, delta, msg, args...) { |
| 945 | return |
| 946 | } |
| 947 | t.FailNow() |
| 948 | } |
| 949 | |
| 950 | // InEpsilon asserts that expected and actual have a relative error less than epsilon |
| 951 | func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { |