Re: Tighten up a few overly lax regexes in pg_dump's tap tests

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-02-05T01:41:19Z
Lists: pgsql-hackers
On Tue, Feb 05, 2019 at 01:50:50PM +1300, David Rowley wrote:
> I think I've done all the ones that use \E.  Those \Q ones don't need
> any escaping. I assume that's the ones you've found.  I didn't do an
> exhaustive check though.

Oh, good point.  I didn't know that anything between \Q and \E are
interpreted as literal characters.  Instead of the approach you are
proposing, perhaps it would make sense to extend this way of doing
things then?  For example some tests with CREATE CONVERSION do so.  It
looks much more portable than having to escape every dot.

>> test_pg_dump's 001_base.pl needs also a refresh.
> 
> Yeah, I thought about looking, but I thought it might be a bottomless pit.

I just double-checked this one, and the regex patterns there look
all correct.
--
Michael

Commits

  1. Align better test output regex with grammar in pg_dump TAP tests

  2. Tighten some regexes with proper character escaping in pg_dump TAP tests