Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Check ordering in StreamGroup.merege tests (#91)
Browse files Browse the repository at this point in the history
See #90 (comment)

Merged streams forward events synchronously so we do know that
guarantees that events keep their order when forwarded. Since it's not
necessary to allow for ordering changes drop the `unorderedEquals`.

Also refactor to async/await from a `completion` matcher.
  • Loading branch information
natebosch authored Oct 4, 2019
1 parent 7d35ce9 commit 3c78ad9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: async
version: 2.4.0
version: 2.4.1-dev

description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
Expand Down
8 changes: 4 additions & 4 deletions test/stream_group_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ main() {
});
});

test("merge() emits events from all components streams", () {
test("merge() emits events from all components streams", () async {
var controller1 = StreamController<String>();
var controller2 = StreamController<String>();

Expand All @@ -433,10 +433,10 @@ main() {
controller2.add("second");
controller2.close();

expect(merged.toList(), completion(unorderedEquals(["first", "second"])));
expect(await merged.toList(), ["first", "second"]);
});

test("mergeBroadcast() emits events from all components streams", () {
test("mergeBroadcast() emits events from all components streams", () async {
var controller1 = StreamController<String>();
var controller2 = StreamController<String>();

Expand All @@ -450,7 +450,7 @@ main() {

expect(merged.isBroadcast, isTrue);

expect(merged.toList(), completion(unorderedEquals(["first", "second"])));
expect(await merged.toList(), ["first", "second"]);
});
}

Expand Down

0 comments on commit 3c78ad9

Please sign in to comment.