Adds the ability for mock expectations to be defined with mock.Anything or mock.AnythingOfType as elements within a slice. This is mainly intended for variadic functions in a new PR for mockery, but can apply to any slice parameter.
Changes
Refactor some of the Arguments.Diff method into a new function which compares a single element of the Arguments list.
Add a new case to that function which detects the presence of both expected and actual being a slice. When found, enumerate those slices and recursively call the compareElements function on each pair. Since this function already handles Anything and AnythingOfType comparisons (as well as argumentMatcher, etc), those values can now be used inside the slice.
@andrewwillette I think that the mock needs a serious cleanup of its implementation before adding more features. Please give feedback on my #1578 proposal.
Summary
Adds the ability for mock expectations to be defined with mock.Anything or mock.AnythingOfType as elements within a slice. This is mainly intended for variadic functions in a new PR for mockery, but can apply to any slice parameter.
Changes
Motivation
Help resolve this PR that had rebase needs.
Related issues
1348