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
I have been using counterfeiter with gotest.tools/assert which uses go-cmp to compare structs. I often find myself using fake.FooArgsForCall(i) and writing an assertion for each of the args.
To make this happen I believe the "argsForCall" struct would need to be exported (currently it is an inline []struct{...}), and we'd need to come up with some new name for FooArgsForCall that returns the struct instead of separate args. I assume the existing FooArgsForCall will need to remain for backwards compatibility.
If there is interest in this change I would be happy to work on it.
The text was updated successfully, but these errors were encountered:
Looking into this I see that Fake.Invocations() can kind of be used for this purpose. It requires using the function name to index into the map, and use untyped []interface{} for the arg list. Exporting the type would remove the need to write a bunch of wrappers around this interface to make the tests readable. Something like:
I have been using counterfeiter with gotest.tools/assert which uses go-cmp to compare structs. I often find myself using
fake.FooArgsForCall(i)
and writing an assertion for each of the args.I would really like to write something like:
To make this happen I believe the "argsForCall" struct would need to be exported (currently it is an inline
[]struct{...}
), and we'd need to come up with some new name forFooArgsForCall
that returns the struct instead of separate args. I assume the existingFooArgsForCall
will need to remain for backwards compatibility.If there is interest in this change I would be happy to work on it.
The text was updated successfully, but these errors were encountered: