(t *testing.T)
| 2311 | } |
| 2312 | |
| 2313 | func 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 | |
| 2336 | func TestInDeltaMapValues(t *testing.T) { |
| 2337 | t.Parallel() |
nothing calls this directly
no test coverage detected