OLD | NEW |
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 library scheduled_test.stream_matcher_test; | 5 library scheduled_test.stream_matcher_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:scheduled_test/scheduled_stream.dart'; | 9 import 'package:scheduled_test/scheduled_stream.dart'; |
10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
11 import 'package:scheduled_test/src/utils.dart'; | 11 import 'package:scheduled_test/src/utils.dart'; |
12 | 12 |
13 import 'package:metatest/metatest.dart'; | |
14 import '../utils.dart'; | 13 import '../utils.dart'; |
15 | 14 |
16 /// Returns a [ScheduledStream] that asynchronously emits the numbers 1 through | 15 /// Returns a [ScheduledStream] that asynchronously emits the numbers 1 through |
17 /// 5 and then closes. | 16 /// 5 and then closes. |
18 ScheduledStream createStream() { | 17 ScheduledStream createStream() { |
19 var controller = new StreamController(); | 18 var controller = new StreamController(); |
20 var stream = new ScheduledStream(controller.stream); | 19 var stream = new ScheduledStream(controller.stream); |
21 | 20 |
22 var future = pumpEventQueue(); | 21 var future = pumpEventQueue(); |
23 for (var i = 1; i <= 5; i++) { | 22 for (var i = 1; i <= 5; i++) { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 expect(error.message, equals( | 308 expect(error.message, equals( |
310 "Expected: is done\n" | 309 "Expected: is done\n" |
311 " Emitted: * 1\n" | 310 " Emitted: * 1\n" |
312 " * 2\n" | 311 " * 2\n" |
313 " * 3\n" | 312 " * 3\n" |
314 " * 4\n" | 313 " * 4\n" |
315 " * 5\n" | 314 " * 5\n" |
316 " Which: stream wasn't finished")); | 315 " Which: stream wasn't finished")); |
317 }); | 316 }); |
318 } | 317 } |
OLD | NEW |