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

Function InDeltaf

require/require.go:940–948  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

938//
939// require.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
940func 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
951func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) {

Callers 1

InDeltafMethod · 0.70

Calls 3

InDeltafFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected