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

Unified Diff: tests/lib/unittest/unittest_test.dart

Issue 10834098: Fix issue 4227 - unittest.dart silently consumes exceptions when expectAsync is active. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« lib/unittest/unittest.dart ('K') | « lib/unittest/unittest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/unittest/unittest_test.dart
===================================================================
--- tests/lib/unittest/unittest_test.dart (revision 10086)
+++ tests/lib/unittest/unittest_test.dart (working copy)
@@ -123,6 +123,11 @@
() => (_testconfig.count == 10));
_defer(_callback);
});
+ } else if (testName == 'async exception test') {
+ test(testName, () {
+ expectAsync0(() {});
+ _defer(() => guardAsync(() { throw "error!"; }));
+ });
}
});
}
@@ -152,7 +157,8 @@
'setup and teardown test',
'correct callback test',
'excess callback test',
- 'completion test'
+ 'completion test',
+ 'async exception test'
];
expected = [
@@ -168,7 +174,8 @@
buildStatusString(1, 0, 0, tests[7], 1),
buildStatusString(0, 0, 1, tests[8], 1,
message: 'Callback called more times than expected (2 > 1).'),
- buildStatusString(1, 0, 0, tests[9], 10)
+ buildStatusString(1, 0, 0, tests[9], 10),
+ buildStatusString(0, 0, 1, tests[10], message: 'Caught error!'),
];
actual = [];
« lib/unittest/unittest.dart ('K') | « lib/unittest/unittest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698