Skip to content

Update 'list_any_order' matching to choose lower priority items first #1102

Description

@michaelboulton

#1092 (comment)

Line 494 selects the first response item that matches each expected item. This can reject a valid unordered match when an earlier broad matcher consumes an item required by a later specific matcher.

For example, expected=[ANYTHING, {"id": 1}] and actual=[{"id": 1}, {"id": 2}] should match. The first expected item consumes {"id": 1}, then the second item cannot match. Use backtracking or bipartite matching to find a complete assignment. Add this case as a regression test.

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