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

Method InEpsilon

assert/assertion_forward.go:758–763  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

756
757// InEpsilon asserts that expected and actual have a relative error less than epsilon
758func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
759 if h, ok := a.t.(tHelper); ok {
760 h.Helper()
761 }
762 return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...)
763}
764
765// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
766func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {

Callers 1

TestInEpsilonWrapperFunction · 0.45

Calls 2

InEpsilonFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestInEpsilonWrapperFunction · 0.36