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

Side by Side Diff: tests/lib/async/stream_from_iterable_test.dart

Issue 48543002: Make Stream.fromIterable only accept a single listen call. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test merging streams. 5 // Test merging streams.
6 library dart.test.stream_from_iterable; 6 library dart.test.stream_from_iterable;
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import "dart:async"; 9 import "dart:async";
10 import '../../../pkg/unittest/lib/unittest.dart'; 10 import '../../../pkg/unittest/lib/unittest.dart';
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 Duration duration = const Duration(milliseconds: 10); 66 Duration duration = const Duration(milliseconds: 10);
67 if (value == 20) { 67 if (value == 20) {
68 subscription.pause(new Future.delayed(duration, () {})); 68 subscription.pause(new Future.delayed(duration, () {}));
69 } 69 }
70 }, onDone: expectAsync0(() { 70 }, onDone: expectAsync0(() {
71 actual.close(); 71 actual.close();
72 Events expected = new Events.fromIterable(iter); 72 Events expected = new Events.fromIterable(iter);
73 Expect.listEquals(expected.events, actual.events); 73 Expect.listEquals(expected.events, actual.events);
74 })); 74 }));
75 }); 75 });
76
77 test("iterable-single-subscription", () {
78 Stream stream = new Stream.fromIterable(iter);
79 stream.listen((x){});
80 Expect.throws(() { stream.listen((x){}); },
81 (e) => e is StateError);
82 });
76 } 83 }
OLDNEW
« 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