MCPcopy Create free account
hub / github.com/stretchr/testify / TestInDeltaMapValues

Function TestInDeltaMapValues

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

Source from the content-addressed store, hash-verified

1940}
1941
1942func TestInDeltaMapValues(t *testing.T) {
1943 mockT := new(testing.T)
1944
1945 for _, tc := range []struct {
1946 title string
1947 expect interface{}
1948 actual interface{}
1949 f func(TestingT, bool, ...interface{}) bool
1950 delta float64
1951 }{
1952 {
1953 title: "Within delta",
1954 expect: map[string]float64{
1955 "foo": 1.0,
1956 "bar": 2.0,
1957 "baz": math.NaN(),
1958 },
1959 actual: map[string]float64{
1960 "foo": 1.01,
1961 "bar": 1.99,
1962 "baz": math.NaN(),
1963 },
1964 delta: 0.1,
1965 f: True,
1966 },
1967 {
1968 title: "Within delta",
1969 expect: map[int]float64{
1970 1: 1.0,
1971 2: 2.0,
1972 },
1973 actual: map[int]float64{
1974 1: 1.0,
1975 2: 1.99,
1976 },
1977 delta: 0.1,
1978 f: True,
1979 },
1980 {
1981 title: "Different number of keys",
1982 expect: map[int]float64{
1983 1: 1.0,
1984 2: 2.0,
1985 },
1986 actual: map[int]float64{
1987 1: 1.0,
1988 },
1989 delta: 0.1,
1990 f: False,
1991 },
1992 {
1993 title: "Within delta with zero value",
1994 expect: map[string]float64{
1995 "zero": 0,
1996 },
1997 actual: map[string]float64{
1998 "zero": 0,
1999 },

Callers

nothing calls this directly

Calls 2

InDeltaMapValuesFunction · 0.70
diffFunction · 0.70

Tested by

no test coverage detected