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

Function TestInDeltaSlice

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

Source from the content-addressed store, hash-verified

2311}
2312
2313func TestInDeltaSlice(t *testing.T) {
2314 t.Parallel()
2315
2316 mockT := new(testing.T)
2317
2318 True(t, InDeltaSlice(mockT,
2319 []float64{1.001, math.NaN(), 0.999},
2320 []float64{1, math.NaN(), 1},
2321 0.1), "{1.001, NaN, 0.009} is element-wise close to {1, NaN, 1} in delta=0.1")
2322
2323 True(t, InDeltaSlice(mockT,
2324 []float64{1, math.NaN(), 2},
2325 []float64{0, math.NaN(), 3},
2326 1), "{1, NaN, 2} is element-wise close to {0, NaN, 3} in delta=1")
2327
2328 False(t, InDeltaSlice(mockT,
2329 []float64{1, math.NaN(), 2},
2330 []float64{0, math.NaN(), 3},
2331 0.1), "{1, NaN, 2} is not element-wise close to {0, NaN, 3} in delta=0.1")
2332
2333 False(t, InDeltaSlice(mockT, "", nil, 1), "Expected non numeral slices to fail")
2334}
2335
2336func TestInDeltaMapValues(t *testing.T) {
2337 t.Parallel()

Callers

nothing calls this directly

Calls 3

TrueFunction · 0.70
InDeltaSliceFunction · 0.70
FalseFunction · 0.70

Tested by

no test coverage detected