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..e317d826cc48fef80d6af0197e1e3f0affca4580 100644 |
--- a/tests/lib/async/future_test.dart |
+++ b/tests/lib/async/future_test.dart |
@@ -876,6 +876,27 @@ 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(4, (i) { |
Lasse Reichstein Nielsen
2016/08/18 11:15:08
change to 5, so there is a potential element after
floitsch
2016/08/18 11:42:55
Done.
|
+ if (i != 3) return new Future.delayed(cms * (i + 1), () => i); |
+ throw "throwing synchronously in iterable"; |
+ }), cleanUp: (index) { |
+ Expect.isTrue(0 <= index && index < 4); |
Lasse Reichstein Nielsen
2016/08/18 11:15:08
< 3
Likely not necessary since you use `index` as
floitsch
2016/08/18 11:42:55
Removed the check.
|
+ 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 +1096,7 @@ main() { |
testWaitCleanUp(); |
testWaitCleanUpError(); |
+ testWaitSyncError(); |
testBadFuture(); |