stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
23.53k stars 1.6k forks source link

Diff on mocking library #1234

Open AgentGoldPaw opened 2 years ago

AgentGoldPaw commented 2 years ago

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?

brackendawson commented 2 years ago

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

brackendawson commented 1 year ago

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