Skip to content

wishlist: new interfaces superlistof(), sublistof() #19

@karenetheridge

Description

@karenetheridge

For testing portions of lists, we have the bag and set interfaces, but both of these are unordered. It would be nice to have interfaces that test ordered slices of lists.

Sadly, this does not work:

cmp_deeply(
    [ 'foo', 'bar', 'baz' ],
    [
        'foo',
        'bar',
        (any(ignore(), ())) x 20,   # from 0 to 20 extra elements
    ],
    'foo and bar appear in this order at the beginning of the list',
);

we get: ... 'got: array with 3 elements... expect: array with 22 elements' :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions