Merge pull request #46336 from Infinisil/overrideExisting

lib: Improve overrideExisting implementation
This commit is contained in:
Jörg Thalheim
2018-09-18 11:37:30 +01:00
committed by GitHub
2 changed files with 21 additions and 4 deletions

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