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

Igor Munkin imun at tarantool.org
Thu Apr 1 01:58:47 MSK 2021


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

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

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

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list