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

Function TestInEpsilonSlice

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

Source from the content-addressed store, hash-verified

2470}
2471
2472func TestInEpsilonSlice(t *testing.T) {
2473 t.Parallel()
2474
2475 mockT := new(testing.T)
2476
2477 True(t, InEpsilonSlice(mockT,
2478 []float64{2.2, math.NaN(), 2.0},
2479 []float64{2.1, math.NaN(), 2.1},
2480 0.06), "{2.2, NaN, 2.0} is element-wise close to {2.1, NaN, 2.1} in epsilon=0.06")
2481
2482 False(t, InEpsilonSlice(mockT,
2483 []float64{2.2, 2.0},
2484 []float64{2.1, 2.1},
2485 0.04), "{2.2, 2.0} is not element-wise close to {2.1, 2.1} in epsilon=0.04")
2486
2487 False(t, InEpsilonSlice(mockT, "", nil, 1), "Expected non numeral slices to fail")
2488}
2489
2490func TestRegexp(t *testing.T) {
2491 t.Parallel()

Callers

nothing calls this directly

Calls 3

TrueFunction · 0.70
InEpsilonSliceFunction · 0.70
FalseFunction · 0.70

Tested by

no test coverage detected