testify icon indicating copy to clipboard operation
testify copied to clipboard

Diff on mocking library

Open ToryMakesThings opened this issue 3 years ago • 2 comments

I have a structure with a field that is a map[string]interface{}, that is matching here is the diff.

map[string]interface {}=map[KEY:30]) != (map[string]interface {}=map[KEY:30]

However you can see they match.... am i missing something?

----- UPDATE

i. forgot when you set a value map[string]interface{}{"KEY": 10} it's an int, but when unmarhsalling it's a float64

so if you do

map[string]interface{}{"KEY": float64(10)} and then unmarshal to another map[string]interface{} it passes.

so my request would be maybe built on top reflect.DeepEqual and show the type mismatch?

ToryMakesThings avatar Jul 20 '22 01:07 ToryMakesThings

I don't know what you're doing here, can your provide a minimal testcase which shows this issue?

brackendawson avatar Jul 22 '22 14:07 brackendawson

Thanks for the updated description. Sounds like we need to change the way the values are printed here.

brackendawson avatar Feb 08 '23 16:02 brackendawson