summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut2024-02-08 20:19:03 +0000
committerPeter Eisentraut2024-02-08 20:19:03 +0000
commita89fa007142ea3a02fd26f9ad980e11cae718e60 (patch)
tree4f98990705a38dbef25efb543eef4d821e633c64 /src
parentd859fdb36fcdf7cf01fcda0c9ea87865e13ddc1f (diff)
Apply pg_dump test cleanups to test_pg_dump as well
Apply the changes from 41a284411e0 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/[email protected]
Diffstat (limited to 'src')
-rw-r--r--src/test/modules/test_pg_dump/t/001_base.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index 339e7459ca7..b8c30c23872 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -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}