mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-14 11:14:36 +02:00
helpers/lib: toLuaObject ignore empty attrs (#312)
This commit is contained in:
parent
3d64fab719
commit
35c56b62a1
2 changed files with 26 additions and 3 deletions
|
@ -68,7 +68,7 @@
|
|||
expected = ''"foo\\bar\nbaz"'';
|
||||
};
|
||||
|
||||
testToLuaObjectShouldFilterNullAttrs = {
|
||||
testToLuaObjectFilters = {
|
||||
expr = helpers.toLuaObject {
|
||||
a = null;
|
||||
b = {};
|
||||
|
@ -78,7 +78,21 @@
|
|||
f = {};
|
||||
};
|
||||
};
|
||||
expected = ''{["b"] = {},["c"] = {},["d"] = {["f"] = {}}}'';
|
||||
expected = ''{}'';
|
||||
};
|
||||
|
||||
testToLuaObjectEmptyTable = {
|
||||
expr = helpers.toLuaObject {
|
||||
a = null;
|
||||
b = {};
|
||||
c = {__empty = null;};
|
||||
d = {
|
||||
e = null;
|
||||
f = {};
|
||||
g = helpers.emptyTable;
|
||||
};
|
||||
};
|
||||
expected = ''{["c"] = { },["d"] = {["g"] = { }}}'';
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue