[Tarantool-patches] [PATCH luajit v3 04/29] test: remove quotes in progname from PUC-Rio

Sergey Kaplun skaplun at tarantool.org
Tue Apr 13 16:27:04 MSK 2021


When LUAJIT_TEST_COMMAND extends the least `arg` slot with some string
containing double quotes, <os.execute> failed to exec this command for
child test.

This patch removes framing '"' to be able to run an extended command
containing '"' and run other test suites.

Part of tarantool/tarantool#5845
Part of tarantool/tarantool#4473
---
 test/PUC-Rio-Lua-5.1-tests/main.lua | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/PUC-Rio-Lua-5.1-tests/main.lua b/test/PUC-Rio-Lua-5.1-tests/main.lua
index f520896a..e72b1896 100644
--- a/test/PUC-Rio-Lua-5.1-tests/main.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/main.lua
@@ -11,7 +11,9 @@ out = os.tmpname()
 do
   local i = 0
   while arg[i] do i=i-1 end
-  progname = '"'..arg[i+1]..'"'
+  -- LuaJIT: remove framing '"' to be able to run an extended
+  -- command containing '"' and run other test suites.
+  progname = arg[i+1]
 end
 print(progname)
 
@@ -53,10 +55,12 @@ prepfile("print(a)", otherprog)
 RUN("lua -l %s -l%s -lstring -l io %s > %s", prog, otherprog, otherprog, out)
 checkout("1\n2\n2\n")
 
+-- LuaJIT: test file is adapted for LuaJIT's test system, see
+-- the comment near `progname` initialization.
 local a = [[
   assert(table.getn(arg) == 3 and arg[1] == 'a' and
          arg[2] == 'b' and arg[3] == 'c')
-  assert(arg[-1] == '--' and arg[-2] == "-e " and arg[-3] == %s)
+  assert(arg[-1] == '--' and arg[-2] == "-e " and arg[-3] == '%s')
   assert(arg[4] == nil and arg[-4] == nil)
   local a, b, c = ...
   assert(... == 'a' and a == 'a' and b == 'b' and c == 'c')
-- 
2.31.0



More information about the Tarantool-patches mailing list