@@ -1971,7 +1971,7 @@ func TestInEpsilonMapValues(t *testing.T) {
1971
1971
title string
1972
1972
expected interface {}
1973
1973
actual interface {}
1974
- f func ( TestingT , bool , ... interface {}) bool
1974
+ f BoolAssertionFunc
1975
1975
epsilon float64
1976
1976
}{
1977
1977
{
@@ -2005,7 +2005,7 @@ func TestInEpsilonMapValues(t *testing.T) {
2005
2005
f : False ,
2006
2006
},
2007
2007
{
2008
- title : "With different map keys" ,
2008
+ title : "Within epsilon with different map keys" ,
2009
2009
expected : map [string ]float64 {
2010
2010
"foo" : 2.2 ,
2011
2011
"baz" : 2.0 ,
@@ -2018,7 +2018,7 @@ func TestInEpsilonMapValues(t *testing.T) {
2018
2018
f : False ,
2019
2019
},
2020
2020
{
2021
- title : "With different number of keys" ,
2021
+ title : "Within epsilon with different number of map keys" ,
2022
2022
expected : map [string ]float64 {
2023
2023
"foo" : 2.2 ,
2024
2024
"baz" : 2.0 ,
@@ -2030,7 +2030,7 @@ func TestInEpsilonMapValues(t *testing.T) {
2030
2030
f : False ,
2031
2031
},
2032
2032
{
2033
- title : "With zero value on expected" ,
2033
+ title : "Within epsilon with zero value on expected" ,
2034
2034
expected : map [string ]float64 {
2035
2035
"foo" : 0 ,
2036
2036
},
@@ -2087,6 +2087,39 @@ func TestInEpsilonMapValues(t *testing.T) {
2087
2087
epsilon : 0.1 ,
2088
2088
f : False ,
2089
2089
},
2090
+ {
2091
+ title : "When expected and actual are not the same type" ,
2092
+ expected : map [string ]float64 {
2093
+ "foo" : 2.1 ,
2094
+ },
2095
+ actual : map [string ]string {
2096
+ "foo" : "2.0" ,
2097
+ },
2098
+ epsilon : 0.1 ,
2099
+ f : False ,
2100
+ },
2101
+ {
2102
+ title : "When expected and actual map value are string" ,
2103
+ expected : map [string ]string {
2104
+ "foo" : "2.1" ,
2105
+ },
2106
+ actual : map [string ]string {
2107
+ "foo" : "2.0" ,
2108
+ },
2109
+ epsilon : 0.1 ,
2110
+ f : False ,
2111
+ },
2112
+ {
2113
+ title : "When expected and actual map value are struct" ,
2114
+ expected : map [string ]struct {}{
2115
+ "foo" : {},
2116
+ },
2117
+ actual : map [string ]struct {}{
2118
+ "foo" : {},
2119
+ },
2120
+ epsilon : 0.1 ,
2121
+ f : False ,
2122
+ },
2090
2123
} {
2091
2124
tc .f (t , InEpsilonMapValues (mockT , tc .expected , tc .actual , tc .epsilon ), tc .title )
2092
2125
}
0 commit comments