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

Sergey Kaplun skaplun at tarantool.org
Fri Apr 2 10:48:05 MSK 2021


Igor,

Thanks for the review!

On 31.03.21, Igor Munkin wrote:
> 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.

Fixed.

> 
> > call non-function object without __call methamethod.
> 
> Typo: s/methamethod/metamethod/.

Fixed.

> 
> > Also, LuaJIT includes variable name to the error report, when try to
> 
> Typo: s/includes variable name/includes the variable name/.

Fixed.

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

Fixed.

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

Fixed.

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

Fixed.

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

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list