Skip to content

Compare arrays content regardless order - "Sort inputs" optional input flag #21

@kosist

Description

@kosist

I have now the following use case - I'd like to test, that arrays are equal by content, regardless position. So, ["a", "b", "c"] at the end is the same as ["c", "a", "b"] (although it is not correct from array's "nature" point of view), because both arrays have the same data (maybe then it is better to call it "list", not array).
The easiest way to do it - is to sort arrays before comparison.
Is it possible to add "Sort inputs" flag to 1D array comparison assert functions, or it will be out of concept?
Thanks a lot in advance,
Sincerely, Ivan.

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