-
Notifications
You must be signed in to change notification settings - Fork 37
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
AllOf() matcher crashes if inner matchers throw #190
Comments
In a similar vein: var expectedValues = generateValues()
..renameKey('someKey', 'someOtherExistingKey'); // -- throws `Bad state: Existing element would be overwrittenexisting value`, but gets supressed due to below
expect(actualValues, expectedValues); which outputs:
Similarly, the workaround for this one is also: -expect(actualValues, equals(expectedValues));
+expect(actualValues, isA<Map>().having((x) => x, 'that', equals(expectedValues))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't have time to create a full PR with tests, but here's a repro and a patch if someone has the time to integrate them.
I believe this is closely related to, but still distinct from #174
Repro
Which outputs:
Fix
Alternate Fix
Since the original code didn't only called
addStateInfo()
for a failed match, the above assumes that's important and as such, preserves the same logic (again, I didn't have time to explore in more depth). If this is not the case and it's indeed acceptable to calladdStateInfo()
in all cases, then the fix becomes simpler:Workaround
For the time being, this crash can be avoided by rewriting the test like so:
The text was updated successfully, but these errors were encountered: