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

_DeepMatcher crash on badly behaved Iterable #174

Open
davidmorgan opened this issue Apr 14, 2021 · 1 comment
Open

_DeepMatcher crash on badly behaved Iterable #174

davidmorgan opened this issue Apr 14, 2021 · 1 comment

Comments

@davidmorgan
Copy link

I don't have time to create a minimal repro right now, but writing this down so it doesn't get lost.

It looks like an iterable that doesn't always return the same results can cause a crash in expect(iterable, [1, 2, 3]).

  NoSuchMethodError: The getter 'describeProblem' was called on null.
  Receiver: null
  Tried calling: describeProblem
  dart:core                                                    Object.noSuchMethod
  package:matcher/src/equals_matcher.dart 273:36               _DeepMatcher.describeMismatch
@davidmorgan
Copy link
Author

Found a repro; it's not about the iterable changing, it's about the iterable throwing.

expect([1].map((x) => throw 'whoops'), []);

-->

  NoSuchMethodError: The getter 'describeProblem' was called on null.
  Receiver: null
  Tried calling: describeProblem
  dart:core                                                                   Object.noSuchMethod
  package:matcher/src/equals_matcher.dart 273:36                              _DeepMatcher.describeMismatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant