From: | Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz>, Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: TAP test utility module 'PG_LSN.pm' |
Date: | 2020-12-01 06:14:06 |
Message-ID: | 421b1c88-a8f2-1137-57f6-add020af6c86@oss.nttdata.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2020/12/01 14:58, Michael Paquier wrote:
> 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.
Agreed.
> Wouldn't it be better to add an
> equivalent of your add() function in the backend then?
You mean the same function as the commit 9bae7e4cde provided?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2020-12-01 06:27:01 | Re: TAP test utility module 'PG_LSN.pm' |
Previous Message | Craig Ringer | 2020-12-01 06:11:08 | Re: TAP test utility module 'PG_LSN.pm' |