You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
When printing output for matched errors, if the expected and actual value have different types, either a special message should be printed (ie. expected value type does not match actual value type), or simply print the type with the output.
My confusing error output:
Expected call at mytest.go:467 doesn't match the argument at index 1.
Got: 8
Want: is equal to 8
In this case, I was using a const val = 8 which is resolved to an int. The const is used in the innards of a struct that expects an int32 (so the const is correctly casted). The const is then passed as the parameter to a method mocked by EXPECT() that originally takes an int32, but the mock version of the method takes an interface{}. Therefore, in the second case, the const is never casted correctly to int32 and causes a type mismatch further down the call path.
The long story short is, it's possible for gomock to print equivalent values without type information.
Nexxow, dylannz, m-eaton, eyoung8, chodyo and 62 moreasif-ir and andangrd