From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B369E43040D for ; Mon, 31 Aug 2020 14:20:02 +0300 (MSK) Date: Mon, 31 Aug 2020 14:20:01 +0300 From: Sergey Bronnikov Message-ID: <20200831112001.GE94343@pony.bronevichok.ru> References: <20200728164130.j7dvrpz7azdonqqa@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200728164130.j7dvrpz7azdonqqa@tkn_work_nb> Subject: Re: [Tarantool-patches] [PATCH 2/2] test: add regression test for table.clear() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org 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@