Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: pkg/unittest/lib/src/core_matchers.dart

Issue 20613003: Fix issue in DeepMatcher where == throws. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/core_matchers.dart
===================================================================
--- pkg/unittest/lib/src/core_matchers.dart (revision 25510)
+++ pkg/unittest/lib/src/core_matchers.dart (working copy)
@@ -130,7 +130,15 @@
String reason = null;
// If _limit is 1 we can only recurse one level into object.
bool canRecurse = depth == 0 || _limit > 1;
- if (expected == actual) {
+ bool equal;
+ try {
+ equal = (expected == actual);
+ } catch (e,s) {
+ // TODO(gram): Add a test for this case.
+ reason = '== threw "$e"';
+ return [reason, location];
+ }
+ if (equal) {
// Do nothing.
} else if (depth > _limit) {
reason = 'recursion depth limit exceeded';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698