postgres.git / summary / log / commit / refs
commit 6ee26c6a4bafabbd22a85f575d2446fd5ec6ad0d
Author: Andrew Dunstan <andrew@dunslane.net>
Date: Tue Jan 30 22:09:44 2024 +0000
First released in: 17.0, 12.18, 13.14, 14.11, 15.6, 16.2
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
src/bin/pg_rewind/t/003_extrafiles.pl | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/bin/pg_rewind/t/003_extrafiles.pl b/src/bin/pg_rewind/t/003_extrafiles.pl
index d54dcddcbb6..7e4c2771ce7 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,
[
[parent: 8ee9c2508751]