[Tarantool-patches] [PATCH v2 luajit 05/30] test: adapt arg availability test from Lua suite

Sergey Kaplun skaplun at tarantool.org
Thu Apr 1 12:37:55 MSK 2021


Igor,

Thanks for the review!

On 01.04.21, Igor Munkin wrote:
> Sergey,
> 
> Thanks for the patch! Please consider the comments below.
> 
> On 26.03.21, Sergey Kaplun wrote:
> > The argument table `arg` can be read (and modified) by `LUA_INIT` and
> > `-e` chunks since the commit 92d9ff211ae864777a8580b5a7326d5f408161ce
> > (Set arg table before evaluating LUA_INIT and -e chunks.).
> > 
> > This behaviour is similar to Lua 5.3, so the test was adapted
> > considering PUC-Rio Lua 5.3 test suite taken from
> > https://www.lua.org/tests/lua-5.3.0-tests.tar.gz.
> > 
> > Closes tarantool/tarantool#5686
> 
> As we discussed before: s/Closes/Resolves/.

I used here Closes intentionly:
I suppose, that the issue is not appeared in Tarantool's repo, so
it is closed as far as the final version of patchset does not
contain the issue.
Looks that it is confusing, changed back to Resolves.

Here and in the patches later.

> 
> > Part of tarantool/tarantool#5845
> > Part of tarantool/tarantool#4473
> > ---
> >  test/PUC-Lua-5.1-tests/main.lua | 14 ++++++++++++--
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> > 
> > diff --git a/test/PUC-Lua-5.1-tests/main.lua b/test/PUC-Lua-5.1-tests/main.lua
> > index 4f8b8bf..c11a576 100644
> > --- a/test/PUC-Lua-5.1-tests/main.lua
> > +++ b/test/PUC-Lua-5.1-tests/main.lua
> > @@ -69,9 +69,19 @@ a = string.format(a, progname)
> >  prepfile(a)
> >  RUN('lua "-e " -- %s a b c', prog)
> >  
> > -prepfile"assert(arg==nil)"
> > +-- test 'arg' availability in libraries
> > +-- LuaJIT: LuaJIT v2.1.0-beta3 has extension from Lua 5.3:
> > +-- The argument table `arg` can be read (and modified)
> > +-- by `LUA_INIT` and `-e` chunks.
> > +-- See commit 92d9ff211ae864777a8580b5a7326d5f408161ce
> > +-- (Set arg table before evaluating LUA_INIT and -e chunks.).
> > +-- See also https://github.com/tarantool/tarantool/issues/5686.
> > +-- In Lua 5.3 this feature was introduced via commit
> > +-- 23f0ff95177eda2e0a80e3a48562cc6837705735.
> > +-- Test is adapted from PUC-Rio Lua 5.3 test suite.
> > +prepfile"assert(arg)"
> >  prepfile("assert(arg)", otherprog)
> > -RUN("lua -l%s - < %s", prog, otherprog)
> > +RUN('env LUA_PATH="?;;" lua -l%s - < %s', prog, otherprog)
> 
> Why LUA_PATH is tweaked here?

Looks like Roberto avoids to load some files with the same name
that can be loaded by the old `LUA_PATH`. I preferred to take it intact
from the Lua 5.3 test suite (even comment about `arg` availability).

> 
> >  
> >  prepfile""
> >  RUN("lua - < %s > %s", prog, out)
> > -- 
> > 2.31.0
> > 
> 
> -- 
> Best regards,
> IM

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list