Re: TAP test utility module 'PG_LSN.pm'

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: TAP test utility module 'PG_LSN.pm'
Дата
Msg-id X8XblBfgLRTOnw/y@paquier.xyz
обсуждение исходный текст
Ответ на TAP test utility module 'PG_LSN.pm'  (Craig Ringer <craig.ringer@enterprisedb.com>)
Ответы Re: TAP test utility module 'PG_LSN.pm'  (Craig Ringer <craig.ringer@enterprisedb.com>)
Re: TAP test utility module 'PG_LSN.pm'  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список pgsql-hackers
On Tue, Dec 01, 2020 at 12:03:41PM +0800, Craig Ringer wrote:
> I'd like to share the attached PG_LSN.pm module that I use when
> writing TAP tests. I suggest that it be considered for inclusion in
> core.
>
> It defines a Perl datatype PG_LSN with operator support, so you can
> write things like
>
>     cmp_ok($got_lsn, "<", $expected_lsn, "testname")
>
> in TAP tests and get sensible results without any concern for LSN
> representation details, locale, etc. You can subtract LSNs to get a
> byte difference too.

In my experience, any TAP tests making use of LSN operations can just
let the backend do the maths, so I am not much a fan of duplicating
that stuff in a perl module.  Wouldn't it be better to add an
equivalent of your add() function in the backend then?  That could
also get tested in the main regression test suite.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hou, Zhijie"
Дата:
Сообщение: RE: [PATCH] Keeps tracking the uniqueness with UniqueKey
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Improving spin-lock implementation on ARM.