summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan2024-01-30 22:09:44 +0000
committerAndrew Dunstan2024-01-30 22:12:32 +0000
commitf3429b0827212bc4746696ebbdda5692d2d6b791 (patch)
tree36b6549c132e7aadcd4550c7140450bc96cdbea2 /src
parent375d30bcbbd07eb82144533fd4a30640af680e81 (diff)
Fix 003_extrafiles.pl test for the Windows
File::Find converts backslashes to slashes in the newer Perl versions. See: https://github.com/Perl/perl5/commit/414f14df98cb1c9a20f92c5c54948b67c09f072d So, do the same conversion for Windows before comparing paths. To support all Perl versions, always convert them on Windows regardless of the Perl's version. Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Backpatch to all live branches
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_rewind/t/003_extrafiles.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/t/003_extrafiles.pl b/src/bin/pg_rewind/t/003_extrafiles.pl
index f4710440fc3..155239c59a7 100644
--- a/src/bin/pg_rewind/t/003_extrafiles.pl
+++ b/src/bin/pg_rewind/t/003_extrafiles.pl
@@ -67,6 +67,19 @@ sub run_test
},
$test_master_datadir);
@paths = sort @paths;
+
+ # File::Find converts backslashes to slashes in the newer Perl
+ # versions. To support all Perl versions, do the same conversion
+ # for Windows before comparing the paths.
+ if ($PostgreSQL::Test::Utils::windows_os)
+ {
+ for my $filename (@paths)
+ {
+ $filename =~ s{\\}{/}g;
+ }
+ $test_primary_datadir =~ s{\\}{/}g;
+ }
+
is_deeply(
\@paths,
[