lib/lua: support nixpkg's "lua-inline" type

See #1935
This commit is contained in:
Matt Sturgeon 2024-08-11 21:17:45 +01:00
parent dbf6f7bc99
commit 4eb2ad7db7
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 24 additions and 1 deletions

View file

@ -65,6 +65,16 @@ let
expected = "<lua code>";
};
testToLuaObjectInlineLua = {
expr = helpers.toLuaObject (lib.generators.mkLuaInline "<lua code>");
expected = "(<lua code>)";
};
testToLuaObjectInlineLuaNested = {
expr = helpers.toLuaObject { lua = lib.generators.mkLuaInline "<lua code>"; };
expected = "{ lua = (<lua code>) }";
};
testToLuaObjectLuaTableMixingList = {
expr = helpers.toLuaObject {
"__unkeyed...." = "foo";