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

Unified Diff: packages/async/test/stream_splitter_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/async/test/stream_sink_transformer_test.dart ('k') | packages/async/test/stream_zip_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/async/test/stream_splitter_test.dart
diff --git a/packages/async/test/stream_splitter_test.dart b/packages/async/test/stream_splitter_test.dart
index ffd0c87afb2899a0f6decf1ac804e93dcc67e447..68a6b74c0cd25c04c57bcfdf5f40a181e2f81b1f 100644
--- a/packages/async/test/stream_splitter_test.dart
+++ b/packages/async/test/stream_splitter_test.dart
@@ -8,7 +8,7 @@ import 'package:async/async.dart';
import 'package:test/test.dart';
main() {
- var controller;
+ StreamController<int> controller;
var splitter;
setUp(() {
controller = new StreamController<int>();
@@ -47,20 +47,22 @@ main() {
controller.close();
var count = 0;
- branch.listen(expectAsync((value) {
- expect(count, anyOf(0, 2));
- expect(value, equals(count + 1));
- count++;
- }, count: 2), onError: expectAsync((error) {
+ branch.listen(
+ expectAsync1((value) {
+ expect(count, anyOf(0, 2));
+ expect(value, equals(count + 1));
+ count++;
+ }, count: 2), onError: expectAsync1((error) {
expect(count, equals(1));
expect(error, equals("error"));
count++;
- }), onDone: expectAsync(() {
+ }), onDone: expectAsync0(() {
expect(count, equals(3));
}));
});
- test("a branch that's created in the middle of a stream replays it", () async {
+ test("a branch that's created in the middle of a stream replays it",
+ () async {
controller.add(1);
controller.add(2);
await flushMicrotasks();
@@ -104,12 +106,12 @@ main() {
controller.add(1);
controller.add(2);
await flushMicrotasks();
-
+
var branch2 = splitter.split();
controller.add(3);
controller.close();
await flushMicrotasks();
-
+
var branch3 = splitter.split();
splitter.close();
@@ -207,7 +209,8 @@ main() {
expect(controller.isPaused, isFalse);
});
- test("the source stream is canceled when it's closed after all branches have "
+ test(
+ "the source stream is canceled when it's closed after all branches have "
"been canceled", () async {
var branch1 = splitter.split();
var branch2 = splitter.split();
@@ -233,7 +236,8 @@ main() {
expect(controller.hasListener, isFalse);
});
- test("the source stream is canceled when all branches are canceled after it "
+ test(
+ "the source stream is canceled when all branches are canceled after it "
"has been closed", () async {
var branch1 = splitter.split();
var branch2 = splitter.split();
@@ -257,7 +261,8 @@ main() {
expect(controller.hasListener, isFalse);
});
- test("a splitter that's closed before any branches are added never listens "
+ test(
+ "a splitter that's closed before any branches are added never listens "
"to the source stream", () {
splitter.close();
@@ -265,7 +270,8 @@ main() {
controller.stream.listen(null);
});
- test("splitFrom splits a source stream into the designated number of "
+ test(
+ "splitFrom splits a source stream into the designated number of "
"branches", () {
var branches = StreamSplitter.splitFrom(controller.stream, 5);
« no previous file with comments | « packages/async/test/stream_sink_transformer_test.dart ('k') | packages/async/test/stream_zip_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698