From 286d2a32f6d12cdbf27ce31bdcb0b091be4cf949 Mon Sep 17 00:00:00 2001 From: Mingun Date: Fri, 8 Mar 2024 12:14:44 +0500 Subject: [PATCH] String concatenation operator in Lua is ".." and not "+" Fixes [info] - lua:f"abc{1}%def" *** FAILED *** [info] ""abc" [.. tostring(1) ..] "%def"" was not equal to ""abc" [+ tostring(1) +] "%def"" (TranslatorSpec.scala:686) [info] Analysis: [info] ""abc" [.. tostring(1) ..] "%def"" -> ""abc" [+ tostring(1) +] "%def"" --- .../scala/io/kaitai/struct/translators/TranslatorSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jvm/src/test/scala/io/kaitai/struct/translators/TranslatorSpec.scala b/jvm/src/test/scala/io/kaitai/struct/translators/TranslatorSpec.scala index 032722cbb..d4ceccd90 100644 --- a/jvm/src/test/scala/io/kaitai/struct/translators/TranslatorSpec.scala +++ b/jvm/src/test/scala/io/kaitai/struct/translators/TranslatorSpec.scala @@ -689,7 +689,7 @@ class TranslatorSpec extends AnyFunSuite { GoCompiler -> "fmt.Sprintf(\"abc%v%%def\", 1)", JavaCompiler -> "\"abc\" + Long.toString(1, 10) + \"%def\"", JavaScriptCompiler -> "\"abc\" + (1).toString(10) + \"%def\"", - LuaCompiler -> "\"abc\" + tostring(1) + \"%def\"", + LuaCompiler -> "\"abc\" .. tostring(1) .. \"%def\"", PerlCompiler -> "\"abc\" . sprintf('%d', 1) . \"\\%def\"", PHPCompiler -> "\"abc\" . strval(1) . \"%def\"", PythonCompiler -> "u\"abc\" + str(1) + u\"%def\"",