Simplify matching pattern check in TAP tests of pg_receivewal
authorMichael Paquier <michael@paquier.xyz>
Tue, 27 Jul 2021 01:58:21 +0000 (10:58 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 27 Jul 2021 01:58:21 +0000 (10:58 +0900)
A check in the ZLIB portion of the test to match the name of a
non-compressed partial segment with a completed compressed segment was
using m//, while a simple equality check is enough.  This makes the test
a bit stricter without impacting its coverage.

Author: Kyotaro Horiguchi
Discussion: https://postgr.es/m/20210726.174622.826565852378770261.horikyota.ntt@gmail.com

src/bin/pg_basebackup/t/020_pg_receivewal.pl

index 47c4ecb073b91ab7fc895f5eb19f2ab72d6f5fef..950083d21c8f2af8ebf67363c95e18da14b2e2b3 100644 (file)
@@ -111,7 +111,7 @@ SKIP:
    # of the previous partial, now-completed WAL segment is updated, keeping
    # its base number.
    $partial_wals[0] =~ s/\.partial$/.gz/;
-   is($zlib_wals[0] =~ m/$partial_wals[0]/,
+   is($zlib_wals[0] eq $partial_wals[0],
        1, "one partial WAL segment is now completed");
    # Update the list of partial wals with the current one.
    @partial_wals = @zlib_partial_wals;