Skip to content

Commit

Permalink
test: add tests for nested iterable (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Mar 1, 2022
1 parent 586c411 commit b239a7e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/equatable_test.dart
Expand Up @@ -819,6 +819,34 @@ void main() {
});
});

group('Nested Iterable Equatable', () {
test('should return when values are same', () {
final instanceA = SimpleEquatable<Iterable<Iterable<String>>>([
['A', 'B', 'C'],
['D', 'E', 'F']
]);
final instanceB = SimpleEquatable<Iterable<Iterable<String>>>([
['A', 'B', 'C'],
['D', 'E', 'F']
]);
expect(instanceA == instanceB, true);
expect(instanceA.hashCode == instanceB.hashCode, true);
});

test('should return when values are different', () {
final instanceA = SimpleEquatable<Iterable<Iterable<String>>>([
['A', 'B', 'C'],
['D', 'E', 'F']
]);
final instanceB = SimpleEquatable<Iterable<Iterable<String>>>([
['a', 'b', 'c'],
['d', 'e', 'f']
]);
expect(instanceA != instanceB, true);
expect(instanceA.hashCode != instanceB.hashCode, true);
});
});

group('List Equatable', () {
test('should return when values are same', () {
final instanceA = SimpleEquatable<List>(<String>['A', 'B']);
Expand Down

0 comments on commit b239a7e

Please sign in to comment.