Open graytonio opened 1 year ago
I needed to figure this out today. For my use case it was sufficient to set mock.MatchExpectationsInOrder(false)
as in the example: https://github.com/go-redis/redismock/blob/master/example/example.go#L72-L74
I have this problem too - this is a problem for any unordered queries i.e coming from a map.
Unless I have it wrong, that flag only allows you to run the redis commands out of order, however in a single command with unsorted data (in my immediate case SINTER), it will not fix the problem.
I would appreciate any suggestions if anyone has one.
When mocking commands like XAdd with multiple values the test will fail randomly depending on the order of the values the mock and client decide to put them in. Is there a way to validate that these commands have the right values without caring about the order?
Example:
This code will randomly either pass or fail.