[Tarantool-patches] [PATCH v2 luajit 10/30] test: adapt test for debug.setlocal in Lua suite

Sergey Kaplun skaplun at tarantool.org
Fri Mar 26 10:42:53 MSK 2021


LuaJIT: Lua 5.1 interprets `...` in the vararg functions like
an additional first argument unlike LuaJIT does.
This behaviour is extension is from Lua 5.2.

This patch adapted test considering LuaJIT's and Lua 5.2 behaviour.
The test is adapted like it done in Lua 5.2 test suite taken from
https://www.lua.org/tests/lua-5.2.0-tests.tar.gz.

Closes tarantool/tarantool#5694
Part of tarantool/tarantool#5845
Part of tarantool/tarantool#4473
---
 test/PUC-Lua-5.1-tests/db.lua | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/PUC-Lua-5.1-tests/db.lua b/test/PUC-Lua-5.1-tests/db.lua
index a8c7196..e5d8885 100644
--- a/test/PUC-Lua-5.1-tests/db.lua
+++ b/test/PUC-Lua-5.1-tests/db.lua
@@ -221,6 +221,13 @@ assert(debug.getinfo(1, "l").currentline == L+11)  -- check count of lines
 
 
 function g(...)
+  -- LuaJIT: Lua 5.1 interprets `...` in the vararg functions like
+  -- an additional first argument unlike LuaJIT does.
+  -- This extension is from Lua 5.2.
+  -- See also https://github.com/tarantool/tarantool/issues/5694.
+  -- Test is adapted from PUC-Rio Lua 5.2 test suite by adding
+  -- additional variable `arg`.
+  local arg = {...}
   do local a,b,c; a=math.sin(40); end
   local feijao
   local AAAA,B = "xuxu", "mamão"
-- 
2.31.0



More information about the Tarantool-patches mailing list