From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v6 2/3] test: add a test for wal_cleanup_delay option
Date: Tue, 30 Mar 2021 00:56:47 +0200 [thread overview]
Message-ID: <5195a08c-aaa7-7aa4-8324-352a9433955f@tarantool.org> (raw)
In-Reply-To: <YGJXaqOSDur8sW2M@grain>
On 30.03.2021 00:40, Cyrill Gorcunov wrote:
> On Tue, Mar 30, 2021 at 12:19:10AM +0200, Vladislav Shpilevoy wrote:
>>>
>>> I need to make sure the .is_paused is false, the assert(x == false)
>>> looks exactly what is needed. and we have similar code in our other
>>> tests, do you prefer assert(not x.is_paused) or what?
>>
>> And there is much much much more tests using the booleans as they
>> are supposed to be used. Why do you need exactly 'false' as a literal?
>
> Wait, I just don't understand. is_paused is a boolean type and
> I compare it with a boolean value. Could you simply point me
> the preferred way to compare if some particular value is false.
> I used assert() 'cause I found similar code, if there some more
> suiatble way to test the value, sure thing I can use whatever
> you prefer, just point me an example.
Ok, I open the latest replication test we added (gh-5536), and
I see the line
assert(box.space.test:count() == 10)
It does not look like this:
assert((box.space.test:count() == 10) == true)
does it? Because it is pointless to have 'boolean' type in a
language if you do the manual comparison with the boolean
constants anyway.
The same as in C you don't code like this:
bool ok = func();
if (ok == false)
error();
You do:
bool ok = func();
if (!ok)
error();
next prev parent reply other threads:[~2021-03-29 22:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-27 11:13 [Tarantool-patches] [PATCH v6 0/3] gc/xlog: delay xlog cleanup until relays are subscribed Cyrill Gorcunov via Tarantool-patches
2021-03-27 11:13 ` [Tarantool-patches] [PATCH v6 1/3] " Cyrill Gorcunov via Tarantool-patches
2021-03-27 11:13 ` [Tarantool-patches] [PATCH v6 2/3] test: add a test for wal_cleanup_delay option Cyrill Gorcunov via Tarantool-patches
2021-03-29 21:07 ` Vladislav Shpilevoy via Tarantool-patches
2021-03-29 21:46 ` Cyrill Gorcunov via Tarantool-patches
2021-03-29 21:54 ` Vladislav Shpilevoy via Tarantool-patches
2021-03-29 21:57 ` Cyrill Gorcunov via Tarantool-patches
2021-03-29 22:19 ` Vladislav Shpilevoy via Tarantool-patches
2021-03-29 22:40 ` Cyrill Gorcunov via Tarantool-patches
2021-03-29 22:56 ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-03-30 7:19 ` Cyrill Gorcunov via Tarantool-patches
2021-03-30 11:55 ` Cyrill Gorcunov via Tarantool-patches
2021-03-30 19:59 ` Vladislav Shpilevoy via Tarantool-patches
2021-03-27 11:13 ` [Tarantool-patches] [PATCH v6 3/3] test: box-tap/gc -- add test for is_paused field Cyrill Gorcunov via Tarantool-patches
2021-03-30 19:57 ` [Tarantool-patches] [PATCH v6 0/3] gc/xlog: delay xlog cleanup until relays are subscribed Vladislav Shpilevoy via Tarantool-patches
2021-03-31 8:28 ` Kirill Yukhin via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5195a08c-aaa7-7aa4-8324-352a9433955f@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=gorcunov@gmail.com \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v6 2/3] test: add a test for wal_cleanup_delay option' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox