[Tarantool-patches] [PATCH v2 luajit 17/45] test: enable <misc/hook_line.lua> LuaJIT test

Sergey Kaplun skaplun at tarantool.org
Mon Aug 26 09:39:31 MSK 2024


Sergey,
Thanks for the review!
Please, consider my answers below.

On 23.08.24, Sergey Bronnikov wrote:
> Sergey,
> 
> On 21.08.2024 11:58, Sergey Kaplun wrote:
> > This patch moves the aforementioned test from the <misc> to the <lang/>
> > directory, includes it in <index>, names the subtests, and adjusts the
> > line numbers in the assertions and filters to match LuaJIT behaviour and
> > the new code layout. Also, it slightly refactors the code to make it
> > closer to our code style.
> >
> > Part of tarantool/tarantool#9398
> > ---
> thanks for the patch! LGTM with a minor comment.

<snipped>

> > +do --- Base test: cycles, function calls.
> > +  debug.sethook(hook, "l", 0)
> > +  -- <-- line 12
> > +  local x
> > +  dummy()
> > +  local y = 1
> > +  dummy() dummy()
> 
> I would place a second call to a separate line. Feel free to ignore.

I guess this tests the line number to return (16) here, see the expected
array with line numbers below.

> 
> 
> 
> > +  local z = 2; local r = true
> > +  while y < 4 do y = y + 1 end
> > +  while z < 4 do
> > +    z = z + 1
> > +  end
> > +  -- <-- line 22
> > +  local v
> > +  debug.sethook(nil, "", 0)
> > +
> > +  assert(#lines > 0)
> > +  while lines[1] < 12 do table.remove(lines, 1) end
> > +  while lines[#lines] > 22 do table.remove(lines) end
> > +
> > +  local s = table.concat(lines, " ")
> > +  assert(s == "13 14 8 15 16 8 8 17 18 18 18 18 19 20 19 20 19" or
> > +         s == "13 14 8 15 16 8 16 8 17 18 18 18 18 19 20 19 20 19")

<snipped>

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list