Skip to content

Commit

Permalink
Add groupBy test
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Jul 21, 2020
1 parent fd72ba4 commit 1e0b331
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/iterable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,18 @@ void main() {
);
});

test("groupBy", () {
expect(
['foo', 'bar', 'baz', 'bop', 'qux']
.groupBy((dynamic string) => string[1]),
equals({
'o': ['foo', 'bop'],
'a': ['bar', 'baz'],
'u': ['qux']
}),
);
});

test('.partition()', () {
expect([].partition((it) => false), <List<int>>[[], []]);
expect([1, 2, 3, 4, 5, 6].partition((it) => it % 2 == 1), [
Expand Down

0 comments on commit 1e0b331

Please sign in to comment.