Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

fix callserrors with empty msg #404

Closed
codyoss opened this issue Feb 22, 2020 · 0 comments · Fixed by #460
Closed

fix callserrors with empty msg #404

codyoss opened this issue Feb 22, 2020 · 0 comments · Fixed by #460
Assignees

Comments

@codyoss
Copy link
Member

codyoss commented Feb 22, 2020

Check exhaustedNum and callsErrors.len() , if it's true, fill with error msg

There is a case where matches will return nil for an ordering error.
e.g.

gomock.InOrder(
  mockFoo.EXPECT().Foo().AnyTimes(),
  mockBar.EXPECT().Bar().AnyTimes(),
  mockBaz.EXPECT().Baz().AnyTimes(),
)

mockFoo.Foo()
mockBar.Bar()
mockFoo.Foo()

This will produce an error message with no additional information following because: (as reported in the issue)

err will always be nil

if err := call.matches(args); err != nil {

len(exhausted) will be 1 and len(expected) will be 0

if len(expected)+len(exhausted) == 0 {

Originally posted by @cvgw in #292 (comment)

@codyoss codyoss added this to the v1.5.0 milestone Mar 4, 2020
@codyoss codyoss modified the milestones: v1.5.0, v1.6.0 Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants