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

Unified Diff: tests/lib/async/futures_test.dart

Issue 68523005: Make Future.wait have an eagerError option that defaults to false. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Combine two versions. Improve error handling. Created 7 years, 1 month 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
« sdk/lib/async/future.dart ('K') | « sdk/lib/async/future.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/futures_test.dart
diff --git a/tests/lib/async/futures_test.dart b/tests/lib/async/futures_test.dart
index 9b7f00a4914a16c5ca9fed3c7f75a4be0e16191d..d7096347b1a4ce5af7d3679c3744b480759cc217 100644
--- a/tests/lib/async/futures_test.dart
+++ b/tests/lib/async/futures_test.dart
@@ -119,6 +119,20 @@ Future testWaitWithMultipleErrorsWithStackTrace() {
});
}
+Future testEagerWait() {
floitsch 2013/11/19 10:50:34 test not called.
Lasse Reichstein Nielsen 2013/11/20 09:29:28 Whoops. Fixed.
+ Completer c1 = new Completer();
+ Completer c2 = new Completer();
+ List<Future> futures = <Future>[c1.future, c2.future];
+ Future waited = Future.wait(futures, eagerError: true);
+ var result = waited.then((v) { throw "should not be called"; },
+ onError: (e, s) {
floitsch 2013/11/19 10:50:34 also test that stack trace is passed through.
Lasse Reichstein Nielsen 2013/11/20 09:29:28 Will do.
+ Expect.equals(e, 42);
+ returntrue;
floitsch 2013/11/19 10:50:34 return true
Lasse Reichstein Nielsen 2013/11/20 09:29:28 Quite obvious that it isn't called too. :(
+ });
+ c1.completeError(42);
+ return result;
+}
+
Future testForEachEmpty() {
return Future.forEach([], (_) {
throw 'should not be called';
« sdk/lib/async/future.dart ('K') | « sdk/lib/async/future.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698