mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
parent
34aa3e00e7
commit
6dc0bda459
2 changed files with 23 additions and 4 deletions
|
@ -45,6 +45,8 @@ let
|
|||
];
|
||||
};
|
||||
|
||||
drv = pkgs.writeText "example-derivation" "hello, world!";
|
||||
|
||||
results = pkgs.lib.runTests {
|
||||
testToLuaObject = {
|
||||
expr = helpers.toLuaObject {
|
||||
|
@ -124,6 +126,23 @@ let
|
|||
expected = ''"foo\\bar\nbaz"'';
|
||||
};
|
||||
|
||||
testToLuaObjectDerivation = {
|
||||
expr = helpers.toLuaObject drv;
|
||||
expected = ''"${drv}"'';
|
||||
};
|
||||
|
||||
testToLuaObjectDerivationNested = {
|
||||
expr = helpers.toLuaObject {
|
||||
a = drv;
|
||||
b = {
|
||||
c = drv;
|
||||
};
|
||||
d = [ drv ];
|
||||
e = [ { f = drv; } ];
|
||||
};
|
||||
expected = ''{ a = "${drv}", b = { c = "${drv}" }, d = { "${drv}" }, e = { { f = "${drv}" } } }'';
|
||||
};
|
||||
|
||||
testToLuaObjectFilters = {
|
||||
expr = helpers.toLuaObject {
|
||||
a = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue