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

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

Issue 10830128: Ability to guard callbacks that may never get called. (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
« no previous file with comments | « 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 10103)
+++ tests/lib/unittest/unittest_test.dart (working copy)
@@ -128,6 +128,17 @@
expectAsync0(() {});
_defer(() => guardAsync(() { throw "error!"; }));
});
+ } else if (testName == 'late exception test') {
+ test('testOne', () {
+ var f = expectAsync0(() {});
+ _defer(protectAsync0(() {
+ _defer(protectAsync0(() => expect(false)));
+ expect(false);
+ }));
+ });
+ test('testTwo', () {
+ _defer(expectAsync0(() {}));
+ });
}
});
}
@@ -158,7 +169,8 @@
'correct callback test',
'excess callback test',
'completion test',
- 'async exception test'
+ 'async exception test',
+ 'late exception test'
];
expected = [
@@ -175,7 +187,8 @@
buildStatusString(0, 0, 1, tests[8], 1,
message: 'Callback called more times than expected (2 > 1).'),
buildStatusString(1, 0, 0, tests[9], 10),
- buildStatusString(0, 0, 1, tests[10], message: 'Caught error!'),
+ buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'),
+ buildStatusString(1, 0, 1, 'testOne', message: 'Callback called after already being marked as done (1).:testTwo:')
Siggi Cherem (dart-lang) 2012/08/02 00:42:09 80 col!
];
actual = [];
« no previous file with comments | « lib/unittest/unittest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698