[Tarantool-patches] [PATCH v2 luajit 04/30] test: remove quotes in progname from <main.lua>
Sergey Kaplun
skaplun at tarantool.org
Fri Mar 26 10:42:47 MSK 2021
When LUAJIT_TEST_COMMAND extend the least `arg` with
some string containing double quotes, bash failed to exec this
command for child test.
This patch removes edged '"' to be able run extended command
containing '"' and run other test suites.
Part of tarantool/tarantool#5845
Part of tarantool/tarantool#4473
---
test/PUC-Lua-5.1-tests/main.lua | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/PUC-Lua-5.1-tests/main.lua b/test/PUC-Lua-5.1-tests/main.lua
index f520896..4f8b8bf 100644
--- a/test/PUC-Lua-5.1-tests/main.lua
+++ b/test/PUC-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 edged '"' to be able run 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