This is an automated email from the ASF dual-hosted git repository.

leborchuk pushed a commit to branch REL_2_STABLE
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 249838ace158f97e029dee452d706f9e2fc268ac
Author: Andrew Dunstan <[email protected]>
AuthorDate: Tue Jan 30 17:09:44 2024 -0500

    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 <[email protected]>
    
    Backpatch to all live branches
    
    (cherry picked from commit 2acba01ddc2a6c9fd15f519ed24b1d8894762e41)
---
 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 8a087f0219e..7a465d2a238 100644
--- a/src/bin/pg_rewind/t/003_extrafiles.pl
+++ b/src/bin/pg_rewind/t/003_extrafiles.pl
@@ -83,6 +83,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,
                [


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to