lib.generators.toLua: allow disabling multiline

This commit is contained in:
Mykola Orliuk
2023-04-23 19:35:52 +02:00
parent a48fd10c86
commit e9b416168a
2 changed files with 23 additions and 10 deletions

View File

@@ -950,13 +950,18 @@ runTests {
};
testToLuaAttrsetWithSpaceInKey = {
expr = generators.toLua {} { "some space and double-quote (\")" = generators.mkLuaInline ''"abc" .. "def"''; };
expr = generators.toLua {} { "some space and double-quote (\")" = 42; };
expected = ''
{
["some space and double-quote (\")"] = ("abc" .. "def")
["some space and double-quote (\")"] = 42
}'';
};
testToLuaWithoutMultiline = {
expr = generators.toLua { multiline = false; } [ 41 43 ];
expected = ''{ 41, 43 }'';
};
testToLuaBasicExample = {
expr = generators.toLua {} {
cmd = [ "typescript-language-server" "--stdio" ];