diff --git a/test/unit/utils_test.dart b/test/unit/utils_test.dart index ef3778f..467f9af 100644 --- a/test/unit/utils_test.dart +++ b/test/unit/utils_test.dart @@ -572,6 +572,64 @@ void main() { isA(), ); }); + + 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(), + ); + + expect( + Utils.merge( + { + 'foo': {undefined, 'bar'} + }, + { + 'foo': {'baz'} + }, + ), + equals( + { + 'foo': {'bar', 'baz'}, + }, + ), + ); + expect( + Utils.merge( + { + 'foo': {undefined, 'bar'} + }, + { + 'foo': {'baz'} + }, + )['foo'], + isA(), + ); + }); }); group('combine', () {