Skip to content

Allow empty subset arrays #14

Open
@codekandis

Description

@codekandis

I have several integration tests where I have to test an array is a subset of another array. These tests are implemented in a generic way for a specific case. The test is fed by data providers. The mentioned subset arrays can be empty in several data sets of the data provider.

Actually your library doesn't support empty subsets and throws an exception. So I could have an conditional assert on "if subset !== empty then assertArraySubset()". But I'd prefer the possibility to test for empty subsets while the subset should always be assumed as known if it's empty or whatever values it contains by the writer of the test. So an error on an empty subset restricts the testing abilities.

Edit

This discovery makes it more a bug report over a feature request.

If I test an empty subset array against an empty array no exception will be thrown which makes its behaviour inconsequent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions