Apply pg_dump test cleanups to test_pg_dump as well

Apply the changes from 41a284411e to the test_pg_dump module as well.
Here, we just apply the new test consistency checks, but we don't need
to fix any existing tests.

Discussion: https://www.postgresql.org/message-id/flat/1f8cb371-e84e-434e-0367-6b716fb16fa1@eisentraut.org
This commit is contained in:
Peter Eisentraut 2024-02-08 21:19:03 +01:00
parent d859fdb36f
commit a89fa00714
1 changed files with 16 additions and 0 deletions

View File

@ -857,6 +857,22 @@ foreach my $run (sort keys %pgdump_runs)
foreach my $test (sort keys %tests)
{
# Check for proper test definitions
#
# There should be a "like" list, even if it is empty. (This
# makes the test more self-documenting.)
if (!defined($tests{$test}->{like}))
{
die "missing \"like\" in test \"$test\"";
}
# Check for useless entries in "unlike" list. Runs that are
# not listed in "like" don't need to be excluded in "unlike".
if ($tests{$test}->{unlike}->{$test_key}
&& !defined($tests{$test}->{like}->{$test_key}))
{
die "useless \"unlike\" entry \"$test_key\" in test \"$test\"";
}
# Run the test listed as a like, unless it is specifically noted
# as an unlike (generally due to an explicit exclusion or similar).
if ($tests{$test}->{like}->{$test_key}