-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot verify 0 times invocations using RepeatedSequence #308
Comments
Could you provide an example of what you want to check exactly (just to be sure I understand correctly) ? Anyway, I think you're right that a feature like that could be useful, I'll think about it. |
@FranckRJ thank you for your response. The feature would indeed be very useful when using data driven tests. Lets think of a function that would initialize, read data from and close a resource. Calls to resource would have always one init, 1 to n read data and 0 to 1 close. Each of the calls may fail and the idea would be to test that we verify the call order and how many calls to each resource funtions. The data would be using params It would be awesome just to have single expression: We have made the change to allow This is because RepeatedSequence with + 0 times means any number of invocations. |
This will never work, because the comma operator is a "weak" ordering, it means "there's You should also always call |
I got the chance to test the |
When running data driven tests it sometimes required to verify 0 invocations in chain of sequences. This is currently impossible as 0 is not allowed in
RepeatedSequence operator*(const Sequence&, int times)
. Relaxing the requirement to not allowing negative numbers lets the tests pass but then the 0 is not used but only ignored. This requires to require Exactly(0) calls to mocked function.It would be great to allow 0 and then require 0 invocations as well in RepeatedSequence.
ps. My humblest thanks to everyone working on this project, it's a lifesaver (at least time saver!)
The text was updated successfully, but these errors were encountered: