aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2024-01-30 17:09:44 -0500
committerAndrew Dunstan <andrew@dunslane.net>2024-01-30 17:11:47 -0500
commit52a9af3b8b9f6ac28c41d2d5d1f743a57e4424e9 (patch)
tree2a180ccb67070bf9598cc472020f6105c02a19ee
parent5d726c72cd0f6b13842896058151bac5f68b4100 (diff)
downloadpostgresql-52a9af3b8b9f6ac28c41d2d5d1f743a57e4424e9.tar.gz
postgresql-52a9af3b8b9f6ac28c41d2d5d1f743a57e4424e9.zip
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
-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 fd2bee5d208..d0840dcbe3d 100644
--- a/src/bin/pg_rewind/t/003_extrafiles.pl
+++ b/src/bin/pg_rewind/t/003_extrafiles.pl
@@ -78,6 +78,19 @@ sub run_test
},
$test_primary_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,
[