Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unorderedMatches misses cases depending on the ordering of the input #2370

Closed
natebosch opened this issue Apr 10, 2018 · 0 comments · Fixed by dart-lang/matcher#74
Closed

Comments

@natebosch
Copy link
Member

// passes
expect([1, 2], unorderedMatches([greaterThan(0), greaterThan(1)]));

// fails
expect([2, 1], unorderedMatches([greaterThan(0), greaterThan(1)]));
natebosch referenced this issue in dart-lang/matcher Apr 11, 2018
Fixes #73

Re-implements the unordered matcher using a recursive search assuming
that matchers can matche multiple values in the input rather than a
greedy algorithm which allows a value to "consume" a matcher that is
needed for some other matcher.

User visible differences:
- May match inputs that would have previously been (incorrectly)
  rejected.
- The failure description no longer includes the index of the matcher
  which is unmatched, and all unmatched matchers are printed rather than
  the first.
natebosch referenced this issue in dart-lang/matcher Apr 11, 2018
Fixes #73

Re-implements the unordered matcher using a recursive search assuming
that matchers can matche multiple values in the input rather than a
greedy algorithm which allows a value to "consume" a matcher that is
needed for some other matcher.

User visible differences:
- May match inputs that would have previously been (incorrectly)
  rejected.
- The failure description no longer includes the index of the matcher
  which is unmatched, and all unmatched matchers are printed rather than
  the first.
natebosch referenced this issue in dart-lang/matcher Apr 11, 2018
Fixes #73

Re-implements the unordered matcher using a recursive search assuming
that matchers can matche multiple values in the input rather than a
greedy algorithm which allows a value to "consume" a matcher that is
needed for some other matcher.

User visible differences:
- May match inputs that would have previously been (incorrectly)
  rejected.
- The failure description no longer includes the index of the matcher
  which is unmatched, and all unmatched matchers are printed rather than
  the first.
natebosch referenced this issue in dart-lang/matcher Apr 11, 2018
Fixes #73

Reimplements the unordered matcher using a recursive search assuming
that matchers can match multiple values in the input rather than a
greedy algorithm which allows a matcher to "consume" a value that is
needed for some other matcher.

User visible differences:
- May match inputs that would have previously been (incorrectly)
  rejected.
- The failure description no longer includes the index of the matcher
  which is unmatched, and all unmatched matchers are printed rather than
  the first.
natebosch referenced this issue in dart-lang/matcher Apr 11, 2018
Fixes #73

Reimplements the unordered matcher using a recursive search assuming
that matchers can match multiple values in the input rather than a
greedy algorithm which allows a matcher to "consume" a value that is
needed for some other matcher.

User visible differences:
- May match inputs that would have previously been (incorrectly)
  rejected.
- The failure description may include a number of unmatched
  expectations if more than 1 is unmatched.
mosuem referenced this issue Oct 17, 2024
Fixes dart-lang/matcher#73

Reimplements the unordered matcher using a recursive search assuming
that matchers can match multiple values in the input rather than a
greedy algorithm which allows a matcher to "consume" a value that is
needed for some other matcher.

User visible differences:
- May match inputs that would have previously been (incorrectly)
  rejected.
- The failure description may include a number of unmatched
  expectations if more than 1 is unmatched.
@mosuem mosuem transferred this issue from dart-lang/matcher Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants