Index: tests/lib/async/futures_test.dart |
diff --git a/tests/lib/async/futures_test.dart b/tests/lib/async/futures_test.dart |
index a9a37e0df3246392a75b586ae123f54ba9fc8f3f..5f3b532173a128480019734ef1ada507cdf2b34e 100644 |
--- a/tests/lib/async/futures_test.dart |
+++ b/tests/lib/async/futures_test.dart |
@@ -238,6 +238,30 @@ Future testDoWhileWithException() { |
}); |
} |
+Future testDoWhileManyFutures() { |
+ int n = 100000; |
+ var ftrue = new Future.value(false); |
+ var ffalse = new Future.value(false); |
+ return Future.doWhile(() { |
+ return (--n > 0) ? ftrue : ffalse; |
+ }).then((_) { |
+ // Success |
+ }, onError: (e, s) { |
+ Expect.fail("$e\n$s"); |
+ }); |
+} |
+ |
+Future testDoWhileManyValues() { |
+ int n = 100000; |
+ return Future.doWhile(() { |
+ return (--n > 0); |
+ }).then((_) { |
+ // Success |
+ }, onError: (e, s) { |
+ Expect.fail("$e\n$s"); |
+ }); |
+} |
+ |
main() { |
List<Future> futures = new List<Future>(); |
@@ -259,10 +283,12 @@ main() { |
futures.add(testDoWhile()); |
futures.add(testDoWhileSync()); |
futures.add(testDoWhileWithException()); |
+ futures.add(testDoWhileManyFutures()); |
+ futures.add(testDoWhileManyValues()); |
asyncStart(); |
Future.wait(futures).then((List list) { |
- Expect.equals(18, list.length); |
+ Expect.equals(20, list.length); |
asyncEnd(); |
}); |
} |