Is it a good idea to implement an order-agnostic variant of the elementsEqual matcher? I don't mind implementing it, I just don't know if I'm testing "the right way".
For context, I'm testing an algorithm that produces an array whose elements are unordered. Under the hood, they're the result of flattening/filtering/processing a dictionary. I want to assert that say, 1, 2, 3 are present (and nothing else), ignoring the order they appear in.
My real elements aren't really sortable, so I can't just sort the expected result and actual result, and compare them that way.
I wouldn't mind implementing this and contributing it. Should I?
Is it a good idea to implement an order-agnostic variant of the
elementsEqualmatcher? I don't mind implementing it, I just don't know if I'm testing "the right way".For context, I'm testing an algorithm that produces an array whose elements are unordered. Under the hood, they're the result of flattening/filtering/processing a dictionary. I want to assert that say,
1,2,3are present (and nothing else), ignoring the order they appear in.My real elements aren't really sortable, so I can't just sort the expected result and actual result, and compare them that way.
I wouldn't mind implementing this and contributing it. Should I?