OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:async/async.dart'; | 7 import 'package:async/async.dart'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 var controller; | 11 StreamController<int> controller; |
12 var splitter; | 12 var splitter; |
13 setUp(() { | 13 setUp(() { |
14 controller = new StreamController<int>(); | 14 controller = new StreamController<int>(); |
15 splitter = new StreamSplitter<int>(controller.stream); | 15 splitter = new StreamSplitter<int>(controller.stream); |
16 }); | 16 }); |
17 | 17 |
18 test("a branch that's created before the stream starts to replay it", | 18 test("a branch that's created before the stream starts to replay it", |
19 () async { | 19 () async { |
20 var events = []; | 20 var events = []; |
21 var branch = splitter.split(); | 21 var branch = splitter.split(); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 expect(branches[0].toList(), completion(equals([1, 2, 3]))); | 277 expect(branches[0].toList(), completion(equals([1, 2, 3]))); |
278 expect(branches[1].toList(), completion(equals([1, 2, 3]))); | 278 expect(branches[1].toList(), completion(equals([1, 2, 3]))); |
279 expect(branches[2].toList(), completion(equals([1, 2, 3]))); | 279 expect(branches[2].toList(), completion(equals([1, 2, 3]))); |
280 expect(branches[3].toList(), completion(equals([1, 2, 3]))); | 280 expect(branches[3].toList(), completion(equals([1, 2, 3]))); |
281 expect(branches[4].toList(), completion(equals([1, 2, 3]))); | 281 expect(branches[4].toList(), completion(equals([1, 2, 3]))); |
282 }); | 282 }); |
283 } | 283 } |
284 | 284 |
285 /// Wait for all microtasks to complete. | 285 /// Wait for all microtasks to complete. |
286 Future flushMicrotasks() => new Future.delayed(Duration.ZERO); | 286 Future flushMicrotasks() => new Future.delayed(Duration.ZERO); |
OLD | NEW |