[Tarantool-patches] [PATCH v2 luajit 14/30] test: adapt activeline check in the PUC Lua test
Igor Munkin
imun at tarantool.org
Wed Mar 31 01:15:58 MSK 2021
Sergey,
Thanks for the patch! LGTM, except the nits below.
On 26.03.21, Sergey Kaplun wrote:
> LuaJIT does not report line with single "end" statement
Typo: s/report line/report the line/.
> (the last line of the function) as an active line in
> debug.getinfo(), unlike Lua does. There is no bytecode
> related to this line, so it is "unreachable" and
> may be considered not active.
>
> This patch excludes the last line of a function from the check,
Typo: s/a function/the function/.
> considering LuaJIT's behaviour.
>
> Closes tarantool/tarantool#5708
As we discussed before: s/Closes/Resolves/.
> Part of tarantool/tarantool#5845
> Part of tarantool/tarantool#4473
> ---
> test/PUC-Lua-5.1-tests/db.lua | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/test/PUC-Lua-5.1-tests/db.lua b/test/PUC-Lua-5.1-tests/db.lua
> index b363abc..c704877 100644
> --- a/test/PUC-Lua-5.1-tests/db.lua
> +++ b/test/PUC-Lua-5.1-tests/db.lua
> @@ -491,7 +491,15 @@ local _, l = coroutine.resume(co, 10)
> local x = debug.getinfo(co, 1, "lfLS")
> assert(x.currentline == l.currentline and x.activelines[x.currentline])
> assert(type(x.func) == "function")
> -for i=x.linedefined + 1, x.lastlinedefined do
> +-- LuaJIT does not report line with single "end" statement
Typo: s/report line/report the line/.
> +-- (the last line of the function) as an active line in
> +-- debug.getinfo(), unlike Lua does. There is no bytecode
> +-- related to this line, so it is "unreachable" and
> +-- may be considered not active.
> +-- See also https://github.com/tarantool/tarantool/issues/5708.
> +-- LuaJIT: Test is adapted for LuaJIT's behaviour by avoiding
> +-- the last line check.
> +for i=x.linedefined + 1, x.lastlinedefined - 1 do
> assert(x.activelines[i])
> x.activelines[i] = nil
> end
> --
> 2.31.0
>
--
Best regards,
IM
More information about the Tarantool-patches
mailing list