MCPcopy Create free account
hub / github.com/stretchr/testify / TestInEpsilonSlice

Function TestInEpsilonSlice

assert/assertions_test.go:2075–2089  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2073}
2074
2075func TestInEpsilonSlice(t *testing.T) {
2076 mockT := new(testing.T)
2077
2078 True(t, InEpsilonSlice(mockT,
2079 []float64{2.2, math.NaN(), 2.0},
2080 []float64{2.1, math.NaN(), 2.1},
2081 0.06), "{2.2, NaN, 2.0} is element-wise close to {2.1, NaN, 2.1} in epsilon=0.06")
2082
2083 False(t, InEpsilonSlice(mockT,
2084 []float64{2.2, 2.0},
2085 []float64{2.1, 2.1},
2086 0.04), "{2.2, 2.0} is not element-wise close to {2.1, 2.1} in epsilon=0.04")
2087
2088 False(t, InEpsilonSlice(mockT, "", nil, 1), "Expected non numeral slices to fail")
2089}
2090
2091func TestRegexp(t *testing.T) {
2092 mockT := new(testing.T)

Callers

nothing calls this directly

Calls 3

TrueFunction · 0.70
InEpsilonSliceFunction · 0.70
FalseFunction · 0.70

Tested by

no test coverage detected