(t *testing.T)
| 1824 | } |
| 1825 | |
| 1826 | func TestInDeltaMapValues(t *testing.T) { |
| 1827 | mockT := new(testing.T) |
| 1828 | |
| 1829 | for _, tc := range []struct { |
| 1830 | title string |
| 1831 | expect interface{} |
| 1832 | actual interface{} |
| 1833 | f func(TestingT, bool, ...interface{}) bool |
| 1834 | delta float64 |
| 1835 | }{ |
| 1836 | { |
| 1837 | title: "Within delta", |
| 1838 | expect: map[string]float64{ |
| 1839 | "foo": 1.0, |
| 1840 | "bar": 2.0, |
| 1841 | "baz": math.NaN(), |
| 1842 | }, |
| 1843 | actual: map[string]float64{ |
| 1844 | "foo": 1.01, |
| 1845 | "bar": 1.99, |
| 1846 | "baz": math.NaN(), |
| 1847 | }, |
| 1848 | delta: 0.1, |
| 1849 | f: True, |
| 1850 | }, |
| 1851 | { |
| 1852 | title: "Within delta", |
| 1853 | expect: map[int]float64{ |
| 1854 | 1: 1.0, |
| 1855 | 2: 2.0, |
| 1856 | }, |
| 1857 | actual: map[int]float64{ |
| 1858 | 1: 1.0, |
| 1859 | 2: 1.99, |
| 1860 | }, |
| 1861 | delta: 0.1, |
| 1862 | f: True, |
| 1863 | }, |
| 1864 | { |
| 1865 | title: "Different number of keys", |
| 1866 | expect: map[int]float64{ |
| 1867 | 1: 1.0, |
| 1868 | 2: 2.0, |
| 1869 | }, |
| 1870 | actual: map[int]float64{ |
| 1871 | 1: 1.0, |
| 1872 | }, |
| 1873 | delta: 0.1, |
| 1874 | f: False, |
| 1875 | }, |
| 1876 | { |
| 1877 | title: "Within delta with zero value", |
| 1878 | expect: map[string]float64{ |
| 1879 | "zero": 0, |
| 1880 | }, |
| 1881 | actual: map[string]float64{ |
| 1882 | "zero": 0, |
| 1883 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…