Index: tests/lib/async/future_test.dart |
diff --git a/tests/lib/async/future_test.dart b/tests/lib/async/future_test.dart |
index 52185f2ae8044981b6624bb2b8f9a4ecf246b3c5..71c509b6fd3973e7790df4418d8b1e55dd7bcb72 100644 |
--- a/tests/lib/async/future_test.dart |
+++ b/tests/lib/async/future_test.dart |
@@ -876,6 +876,26 @@ void testWaitCleanUpError() { |
}); |
} |
+void testWaitSyncError() { |
+ var cms = const Duration(milliseconds: 100); |
+ var cleanups = new List.filled(3, false); |
+ var uncaughts = new List.filled(3, false); |
+ asyncStart(); |
+ asyncStart(); |
+ runZoned(() { |
+ Future.wait(new Iterable.generate(5, (i) { |
+ if (i != 3) return new Future.delayed(cms * (i + 1), () => i); |
+ throw "throwing synchronously in iterable"; |
+ }), cleanUp: (index) { |
+ Expect.isFalse(cleanups[index]); |
+ cleanups[index] = true; |
+ if (cleanups.every((x) => x)) asyncEnd(); |
+ }); |
+ }, onError: (e, s) { |
+ asyncEnd(); |
+ }); |
+} |
+ |
void testBadFuture() { |
var bad = new BadFuture(); |
// Completing with bad future (then call throws) puts error in result. |
@@ -1075,6 +1095,7 @@ main() { |
testWaitCleanUp(); |
testWaitCleanUpError(); |
+ testWaitSyncError(); |
testBadFuture(); |