lib/tests: Add overrideExisting tests

This commit is contained in:
Silvan Mosberger 2018-09-17 22:40:08 +02:00
parent 5cfdec6e94
commit afd8620621
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7

View File

@ -236,6 +236,20 @@ runTests {
};
};
testOverrideExistingEmpty = {
expr = overrideExisting {} { a = 1; };
expected = {};
};
testOverrideExistingDisjoint = {
expr = overrideExisting { b = 2; } { a = 1; };
expected = { b = 2; };
};
testOverrideExistingOverride = {
expr = overrideExisting { a = 3; b = 2; } { a = 1; };
expected = { a = 1; b = 2; };
};
# GENERATORS
# these tests assume attributes are converted to lists