[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 17:45:54 MSK 2021


Hi, thanks for the review!

On 26.03.21, Sergey Ostanevich wrote:
> LGTM, minor update to message
> 
> Sergos
> 
> > On 26 Mar 2021, at 10:42, Sergey Kaplun <skaplun at tarantool.org> wrote:
> > 
> > LuaJIT: Lua 5.1 interprets `...` in the vararg functions like
> > an additional first argument unlike LuaJIT does.
>                ^^^^^^^^^^^ means local? 
> So, that getlocal() later in g() works as expected?

Yes, local is correct. Update commit message and the comment, branch is
force-pushed. See the iterative patch below.

The new commit message is:
===================================================================
test: adapt test for debug.setlocal in Lua suite

LuaJIT: Lua 5.1 interprets `...` in the vararg functions like
an additional local 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.

Part of tarantool/tarantool#5694
Part of tarantool/tarantool#5845
Part of tarantool/tarantool#4473
===================================================================

===================================================================
diff --git a/test/PUC-Lua-5.1-tests/db.lua b/test/PUC-Lua-5.1-tests/db.lua
index e5d8885..6535594 100644
--- a/test/PUC-Lua-5.1-tests/db.lua
+++ b/test/PUC-Lua-5.1-tests/db.lua
@@ -222,7 +222,7 @@ 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.
+  -- an additional local 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
===================================================================

> 
> > 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 is more correct here.

> > 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
> > 
> 

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list