(t *testing.T)
| 2334 | } |
| 2335 | |
| 2336 | func TestInDeltaMapValues(t *testing.T) { |
| 2337 | t.Parallel() |
| 2338 | |
| 2339 | mockT := new(testing.T) |
| 2340 | |
| 2341 | for _, tc := range []struct { |
| 2342 | title string |
| 2343 | expect interface{} |
| 2344 | actual interface{} |
| 2345 | f func(TestingT, bool, ...interface{}) bool |
| 2346 | delta float64 |
| 2347 | }{ |
| 2348 | { |
| 2349 | title: "Within delta", |
| 2350 | expect: map[string]float64{ |
| 2351 | "foo": 1.0, |
| 2352 | "bar": 2.0, |
| 2353 | "baz": math.NaN(), |
| 2354 | }, |
| 2355 | actual: map[string]float64{ |
| 2356 | "foo": 1.01, |
| 2357 | "bar": 1.99, |
| 2358 | "baz": math.NaN(), |
| 2359 | }, |
| 2360 | delta: 0.1, |
| 2361 | f: True, |
| 2362 | }, |
| 2363 | { |
| 2364 | title: "Within delta", |
| 2365 | expect: map[int]float64{ |
| 2366 | 1: 1.0, |
| 2367 | 2: 2.0, |
| 2368 | }, |
| 2369 | actual: map[int]float64{ |
| 2370 | 1: 1.0, |
| 2371 | 2: 1.99, |
| 2372 | }, |
| 2373 | delta: 0.1, |
| 2374 | f: True, |
| 2375 | }, |
| 2376 | { |
| 2377 | title: "Different number of keys", |
| 2378 | expect: map[int]float64{ |
| 2379 | 1: 1.0, |
| 2380 | 2: 2.0, |
| 2381 | }, |
| 2382 | actual: map[int]float64{ |
| 2383 | 1: 1.0, |
| 2384 | }, |
| 2385 | delta: 0.1, |
| 2386 | f: False, |
| 2387 | }, |
| 2388 | { |
| 2389 | title: "Within delta with zero value", |
| 2390 | expect: map[string]float64{ |
| 2391 | "zero": 0, |
| 2392 | }, |
| 2393 | actual: map[string]float64{ |
nothing calls this directly
no test coverage detected