From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 5C5594696C3 for ; Tue, 14 Apr 2020 10:49:55 +0300 (MSK) Date: Tue, 14 Apr 2020 10:49:53 +0300 From: Sergey Bronnikov Message-ID: <20200414074953.GA51517@pony.bronevichok.ru> References: <8753132aaa1c161714064bb97ffcd97e0231c586.1586341316.git.sergeyb@tarantool.org> <2a256771-68aa-df00-6522-eb99e91cf1ee@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2a256771-68aa-df00-6522-eb99e91cf1ee@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 2/6] Fix luacheck warnings in test/ List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: o.piskunov@tarantool.org, Sergey Bronnikov , tarantool-patches@dev.tarantool.org On 18:54 Sat 11 Apr , Vladislav Shpilevoy wrote: > Hi! Thanks for the patch! > > > diff --git a/test/box/iproto_stress.result b/test/box/iproto_stress.result > > index 7149d6c52..3b5b0a031 100644 > > --- a/test/box/iproto_stress.result > > +++ b/test/box/iproto_stress.result > > @@ -76,13 +76,13 @@ test_run:wait_cond(function() return n_workers == 0 end, 60) > > --- > > - true > > ... > > -n_workers -- 0 > > +assert(n_workers == 0) > > These changes should not be done, IMO. Most of our > tests are diff based, and therefore it is ok to write > a statement just to print it. It is not only simpler, but > also allows to print the actual value, if it didn't match > the expected value. > For example, if n_workers becomes not 0, we would see its > actual value in the diff. When we use assert(), we won't > see anything except an error message 'assertion failed'. I'm used to the language that has "smart" assertions that show content compared by asserts. Like pytest - https://docs.pytest.org/en/3.0.1/assert.html Example: def test_function(): > assert f() == 4 E assert 3 == 4 E + where 3 = f() > I propose to allow writing non-functional statements in > test/ dir. removed previously added asserts -- sergeyb@