Skip to content

Commit

Permalink
✅ add more Set tests
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Apr 10, 2024
1 parent e9e860c commit 1fd3128
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions test/unit/utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,64 @@ void main() {
isA<Map>(),
);
});

test('merge set with undefined with another set', () {
final Undefined undefined = const Undefined();

expect(
Utils.merge(
{
'foo': {'bar'}
},
{
'foo': {undefined, 'baz'}
},
),
equals(
{
'foo': {'bar', 'baz'},
},
),
);
expect(
Utils.merge(
{
'foo': {'bar'}
},
{
'foo': {undefined, 'baz'}
},
)['foo'],
isA<Set>(),
);

expect(
Utils.merge(
{
'foo': {undefined, 'bar'}
},
{
'foo': {'baz'}
},
),
equals(
{
'foo': {'bar', 'baz'},
},
),
);
expect(
Utils.merge(
{
'foo': {undefined, 'bar'}
},
{
'foo': {'baz'}
},
)['foo'],
isA<Set>(),
);
});
});

group('combine', () {
Expand Down

0 comments on commit 1fd3128

Please sign in to comment.