test: fixed tests for `Util.merge`

This commit is contained in:
Folke Lemaitre 2023-01-12 13:16:23 +01:00
parent 3f3d9df324
commit f3695bc5be
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 14 deletions

View File

@ -148,25 +148,13 @@ describe("util", function()
output = { a = { 3 } }, output = { a = { 3 } },
}, },
{ {
input = { { b = { 1, 2 } }, { a = { 3 }, __merge = false } }, input = { { b = { 1, 2 } }, { a = { 3 }, b = vim.NIL } },
output = { a = { 3 } }, output = { a = { 3 } },
}, },
{ {
input = { { a = 1 }, { b = 2, __merge = false } }, input = { { a = 1 }, { b = 2, a = vim.NIL } },
output = { b = 2 }, output = { b = 2 },
}, },
{
input = { { a = { 1, 2 } }, { a = { 3, __merge = true } } },
output = { a = { 1, 2, 3 } },
},
{
input = { { a = { 1, 2, __merge = true } }, { a = { 3 } } },
output = { a = { 1, 2, 3 } },
},
{
input = { { a = { 1, 2, __merge = true } }, { a = { 3, __merge = false } } },
output = { a = { 3 } },
},
} }
for _, test in ipairs(tests) do for _, test in ipairs(tests) do