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

Unified Diff: tests/lib/async/stream_subscription_as_future_test.dart

Issue 1295843002: The return-value of 'asFuture' isn't necessarily related to the Stream's type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « sdk/lib/async/stream_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ef868e28fc7308d7399a8d89e28e9e14af7f7d51..ac1293b0297ba9b8c1f9d429c89b22e9f0d21680 100644
--- a/tests/lib/async/stream_subscription_as_future_test.dart
+++ b/tests/lib/async/stream_subscription_as_future_test.dart
@@ -40,6 +40,18 @@ main() {
}));
});
+ test("subscription.asStream different type", () {
+ Stream stream = new Stream<int>.fromIterable([1, 2, 3]);
+ var asyncCallback = expectAsync(() => {});
+ var output = [];
+ var subscription = stream.listen((x) { output.add(x); });
+ subscription.asFuture("string").then((String o) {
+ Expect.listEquals([1, 2, 3], output);
+ Expect.equals("string", o);
+ asyncCallback();
+ });
+ });
+
test("subscription.asStream failure", () {
StreamController controller = new StreamController(sync: true);
[1, 2, 3].forEach(controller.add);
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698