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

Unified Diff: tests/corelib/futures_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « tests/corelib/future_test.dart ('k') | tests/corelib/has_next_iterator_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/futures_test.dart
diff --git a/tests/corelib/futures_test.dart b/tests/corelib/futures_test.dart
index 70a54bfbb441970442a79bf2079eb1f80e411e9d..ec68075d00d7e836fb3af67a2d789e987916043b 100644
--- a/tests/corelib/futures_test.dart
+++ b/tests/corelib/futures_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
library futures_test;
+import 'dart:async';
import 'dart:isolate';
Future testWaitEmpty() {
@@ -38,7 +39,7 @@ Future testForEach() {
return Futures.forEach([1, 2, 3, 4, 5], (n) {
seen.add(n);
return new Future.immediate(null);
- }).transform((_) => Expect.listEquals([1, 2, 3, 4, 5], seen));
+ }).then((_) => Expect.listEquals([1, 2, 3, 4, 5], seen));
}
Future testForEachWithException() {
@@ -47,10 +48,10 @@ Future testForEachWithException() {
if (n == 4) throw 'correct exception';
seen.add(n);
return new Future.immediate(null);
- }).transform((_) {
+ }).then((_) {
throw 'incorrect exception';
- }).transformException((e) {
- Expect.equals('correct exception', e);
+ }).catchError((e) {
+ Expect.equals('correct exception', e.error);
});
}
@@ -63,7 +64,7 @@ main() {
futures.add(testForEachEmpty());
futures.add(testForEach());
- // Use a receive port for blocking the test.
+ // Use a receive port for blocking the test.
// Note that if the test fails, the program will not end.
ReceivePort port = new ReceivePort();
Futures.wait(futures).then((List list) {
« no previous file with comments | « tests/corelib/future_test.dart ('k') | tests/corelib/has_next_iterator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698