[Tarantool-patches] [PATCH v2 luajit 22/30] test: disable PUC Lua test for var names in error

Igor Munkin imun at tarantool.org
Wed Mar 31 22:23:38 MSK 2021


Sergey,

Thanks for the patch! LGTM, except the nits below.

On 26.03.21, Sergey Kaplun wrote:
> LuaJIT includes variable name to the error report, when try to

Minor: "error message" is more correct than "error report" here.

> call non-function object without __call methamethod.

Typo: s/methamethod/metamethod/.

> Also, LuaJIT includes variable name to the error report, when try to

Typo: s/includes variable name/includes the variable name/.

> perform unacceptable arifmetic operation with the variable.
> Lua 5.1 doesn't report variable name in these errors.
> 
> Test ckecked that variable name aren't reported are disabled by

Typo: s/Test checked/Tests checking/.
Typo: s/name aren't reported/name isn't reported/.

> this patch.
> 
> Part of tarantool/tarantool#5845
> Part of tarantool/tarantool#4473
> ---
>  test/PUC-Lua-5.1-tests/errors.lua | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/test/PUC-Lua-5.1-tests/errors.lua b/test/PUC-Lua-5.1-tests/errors.lua
> index e881211..cf24e40 100644
> --- a/test/PUC-Lua-5.1-tests/errors.lua
> +++ b/test/PUC-Lua-5.1-tests/errors.lua
> @@ -72,8 +72,13 @@ checkmessage("b=1; local aaa='a'; x=aaa+b", "local 'aaa'")
>  checkmessage("aaa={}; x=3/aaa", "global 'aaa'")
>  checkmessage("aaa='2'; b=nil;x=aaa*b", "global 'b'")
>  checkmessage("aaa={}; x=-aaa", "global 'aaa'")
> -assert(not string.find(doit"aaa={}; x=(aaa or aaa)+(aaa and aaa)", "'aaa'"))
> -assert(not string.find(doit"aaa={}; (aaa or aaa)()", "'aaa'"))
> +-- LuaJIT: LuaJIT includes variable name to the error report.

Minor: "error message" fits better than "error report".

> +-- It looks like:
> +-- "attempt to perform arithmetic on global 'aaa' (a table value)"
> +-- Lua 5.1 doesn't report variable name here.

Typo: s/report variable name/report the variable name/.

> +-- Tests are disabled for LuaJIT.
> +-- assert(not string.find(doit"aaa={}; x=(aaa or aaa)+(aaa and aaa)", "'aaa'"))
> +-- assert(not string.find(doit"aaa={}; (aaa or aaa)()", "'aaa'"))
>  
>  checkmessage([[aaa=9
>  repeat until 3==3
> -- 
> 2.31.0
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list