Skip to content

New feature idea: elementsEqualIgnoringOrderΒ #798

@amomchilov

Description

@amomchilov
  • I have read CONTRIBUTING and have done my best to follow them.

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions