| Index: tests/lib/async/future_value_chain_test.dart
|
| diff --git a/tests/lib/async/catch_errors_test.dart b/tests/lib/async/future_value_chain_test.dart
|
| similarity index 51%
|
| copy from tests/lib/async/catch_errors_test.dart
|
| copy to tests/lib/async/future_value_chain_test.dart
|
| index f4e0eef4ad4edd8ea78700c3cd684d0188495bc1..3cec185dbbda7c14ade2565239b7b7c80db105b7 100644
|
| --- a/tests/lib/async/catch_errors_test.dart
|
| +++ b/tests/lib/async/future_value_chain_test.dart
|
| @@ -5,18 +5,19 @@
|
| import 'package:async_helper/async_helper.dart';
|
| import "package:expect/expect.dart";
|
| import 'dart:async';
|
| -import 'catch_errors.dart';
|
| +
|
|
|
| main() {
|
| asyncStart();
|
| - // Make sure `catchErrors` shuts down the error stream when the synchronous
|
| - // operation is done and there isn't any asynchronous pending callback.
|
| - catchErrors(() {
|
| - return 'allDone';
|
| - }).listen((x) {
|
| - Expect.fail("Unexpected callback");
|
| - },
|
| - onDone: () {
|
| + var errorFuture = new Future.error(499);
|
| + errorFuture.catchError((x) {
|
| + Expect.equals(499, x);
|
| + var valueChainFuture = new Future.value(errorFuture);
|
| + // The errorFuture must not be propagated immediately as we would otherwise
|
| + // not have time to catch the error.
|
| + valueChainFuture.catchError((error) {
|
| + Expect.equals(499, error);
|
| asyncEnd();
|
| });
|
| + });
|
| }
|
|
|