Closed bxshcn closed 3 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
i'll re-PR with another email.
when I tries to make a test of GoMock referring to the example listed in the doc, I always get
--- FAIL: TestMyThing (0.00s) c:\Users\bxshc\Documents\projects\design-pattern\48\busi\busi_test.go:22: Unexpected call to *mock_busi.MockMyInterface.SomeMethod1([4]) at c:/Users/bxshc/Documents/projects/design-pattern/48/busi/mock_busi/mock_busi.go:50 because: expected call at c:/Users/bxshc/Documents/projects/design-pattern/48/busi/busi_test.go:18 doesn't match the argument at index 0. Got: 4 Want: is equal to 4
so I think there maybe something wrong with the type, then I debug it and found that it should specify the exact type of 4 as int64, a pure 4 will result in a type of int.
the change is very simple, just as
mockObj.EXPECT().SomeMethod(int64(4), "blah")
so that's all, may you should change the example or make a more intelligent infer from the original interface information when generate the mock code.
thanks!