]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Improve TAP tests by replacing ok() with better Test::More functions
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 17 Oct 2025 15:25:53 +0000 (11:25 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 17 Oct 2025 15:25:53 +0000 (11:25 -0400)
Transpose the changes made by commit fabb33b35 in 002_pg_dump.pl
into its recently-created clone 006_pg_dump_compress.pl.

src/bin/pg_dump/t/006_pg_dump_compress.pl

index b429df19a4d9358fda1c900136d5fc91d471cf30..06acb771116e54650fbf177ea3dc1e43cc5344af 100644 (file)
@@ -612,7 +612,8 @@ foreach my $run (sort keys %pgdump_runs)
                if (($tests{$test}->{like}->{$test_key} || $tests{$test}->{all_runs})
                        && !defined($tests{$test}->{unlike}->{$test_key}))
                {
-                       if (!ok($output_file =~ $tests{$test}->{regexp},
+                       if (!like(
+                                       $output_file, $tests{$test}->{regexp},
                                        "$run: should dump $test"))
                        {
                                diag("Review $run results in $tempdir");
@@ -620,7 +621,8 @@ foreach my $run (sort keys %pgdump_runs)
                }
                else
                {
-                       if (!ok($output_file !~ $tests{$test}->{regexp},
+                       if (!unlike(
+                                       $output_file, $tests{$test}->{regexp},
                                        "$run: should not dump $test"))
                        {
                                diag("Review $run results in $tempdir");