TAP test utility module 'PG_LSN.pm'

From: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: TAP test utility module 'PG_LSN.pm'
Date: 2020-12-01 04:03:41
Message-ID: CAGRY4nzBk-vugFyJpLOmwXzbq5MTEQk-+EkzE4=rrUhLTH6ESA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all

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.

It's small but I've found it handy.

Attachment Content-Type Size
PG_LSN.pm application/x-perl 4.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-12-01 04:35:49 PG vs LLVM 12 on seawasp, next round
Previous Message Tom Lane 2020-12-01 04:01:25 Re: Printing backtrace of postgres processes