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

Function InEpsilon

require/require.go:951–959  ·  view source on GitHub ↗

InEpsilon asserts that expected and actual have a relative error less than epsilon

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

Source from the content-addressed store, hash-verified

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{}) {
952 if h, ok := t.(tHelper); ok {
953 h.Helper()
954 }
955 if assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) {
956 return
957 }
958 t.FailNow()
959}
960
961// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
962func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) {

Callers 1

InEpsilonMethod · 0.70

Calls 3

InEpsilonFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected