Index: tests/lib/async/stream_subscription_as_future_test.dart |
diff --git a/tests/lib/async/stream_subscription_as_future_test.dart b/tests/lib/async/stream_subscription_as_future_test.dart |
index 841298b1990339a5440dff21a6bb59d35b4307e8..ac1293b0297ba9b8c1f9d429c89b22e9f0d21680 100644 |
--- a/tests/lib/async/stream_subscription_as_future_test.dart |
+++ b/tests/lib/async/stream_subscription_as_future_test.dart |
@@ -10,7 +10,7 @@ import 'dart:async'; |
import 'package:unittest/unittest.dart'; |
main() { |
- test("subscription.asFuture success", () { |
+ test("subscription.asStream success", () { |
Stream stream = new Stream.fromIterable([1, 2, 3]); |
var output = []; |
var subscription = stream.listen((x) { output.add(x); }); |
@@ -19,7 +19,7 @@ main() { |
})); |
}); |
- test("subscription.asFuture success2", () { |
+ test("subscription.asStream success2", () { |
StreamController controller = new StreamController(sync: true); |
[1, 2, 3].forEach(controller.add); |
controller.close(); |
@@ -31,7 +31,7 @@ main() { |
})); |
}); |
- test("subscription.asFuture success 3", () { |
+ test("subscription.asStream success 3", () { |
Stream stream = new Stream.fromIterable([1, 2, 3]).map((x) => x); |
var output = []; |
var subscription = stream.listen((x) { output.add(x); }); |
@@ -40,7 +40,7 @@ main() { |
})); |
}); |
- test("subscription.asFuture different type", () { |
+ test("subscription.asStream different type", () { |
Stream stream = new Stream<int>.fromIterable([1, 2, 3]); |
var asyncCallback = expectAsync(() => {}); |
var output = []; |
@@ -52,7 +52,7 @@ main() { |
}); |
}); |
- test("subscription.asFuture failure", () { |
+ test("subscription.asStream failure", () { |
StreamController controller = new StreamController(sync: true); |
[1, 2, 3].forEach(controller.add); |
controller.addError("foo"); |
@@ -65,7 +65,7 @@ main() { |
})); |
}); |
- test("subscription.asFuture failure2", () { |
+ test("subscription.asStream failure2", () { |
Stream stream = new Stream.fromIterable([1, 2, 3, 4]) |
.map((x) { |
if (x == 4) throw "foo"; |
@@ -77,50 +77,4 @@ main() { |
Expect.equals(error, "foo"); |
})); |
}); |
- |
- test("subscription.asFuture delayed cancel", () { |
- var completer = new Completer(); |
- var controller = |
- new StreamController(onCancel: () => completer.future, sync: true); |
- [1, 2, 3].forEach(controller.add); |
- controller.addError("foo"); |
- controller.close(); |
- Stream stream = controller.stream; |
- var output = []; |
- var subscription = stream.listen((x) { output.add(x); }); |
- bool catchErrorHasRun = false; |
- subscription.asFuture(output).catchError(expectAsync((error) { |
- Expect.equals(error, "foo"); |
- catchErrorHasRun = true; |
- })); |
- Timer.run(expectAsync(() { |
- Expect.isFalse(catchErrorHasRun); |
- completer.complete(); |
- })); |
- }); |
- |
- test("subscription.asFuture failure in cancel", () { |
- runZoned(() { |
- var completer = new Completer(); |
- var controller = |
- new StreamController(onCancel: () => completer.future, sync: true); |
- [1, 2, 3].forEach(controller.add); |
- controller.addError("foo"); |
- controller.close(); |
- Stream stream = controller.stream; |
- var output = []; |
- var subscription = stream.listen((x) { output.add(x); }); |
- bool catchErrorHasRun = false; |
- subscription.asFuture(output).catchError(expectAsync((error) { |
- Expect.equals(error, "foo"); |
- catchErrorHasRun = true; |
- })); |
- Timer.run(expectAsync(() { |
- Expect.isFalse(catchErrorHasRun); |
- completer.completeError(499); |
- })); |
- }, onError: expectAsync((e) { |
- Expect.equals(499, e); |
- })); |
- }); |
} |