[Tarantool-patches] [PATCH 2/2] test: add regression test for table.clear()

Sergey Bronnikov sergeyb at tarantool.org
Mon Aug 31 14:20:01 MSK 2020


Alexander, thanks for review!

On 19:41 Tue 28 Jul , Alexander Turenko wrote:
> > --- /dev/null
> > +++ b/test/box-tap/gh-5210-table-clear.test.lua
> 
> I would place it into app-tap, because it is not related to box.

ok, moved to app-tap suite.

> > +t = {a = 1, b = 2}
> 
> I would use 'local' here.

Added.

> > +test:is(table.clear(t), nil, 'table clear')
> 
> I would check that the table is cleared: say, using `next(t)`. It must
> return `nil` for an empty table.

Added is_deeply() to make sure it is empty:

local t = {a = 1, b = 2}
test:is(table.clear(t), nil, 'table clear')
test:is_deeply(t, {}, 'table is clear')

> WBR, Alexander Turenko.

-- 
sergeyb@


More information about the Tarantool-patches mailing list