]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/lei.t: quiet newline warning on older Perls
authorEric Wong <e@80x24.org>
Thu, 8 Jun 2023 18:26:08 +0000 (18:26 +0000)
committerEric Wong <e@80x24.org>
Fri, 9 Jun 2023 09:21:29 +0000 (09:21 +0000)
Perl < 5.22 warned on newlines in the middle of a string instead
of just the end.  Workaround it by disabling all warnings on older
Perls while running File::Path::mkpath.

t/lei.t

diff --git a/t/lei.t b/t/lei.t
index a80143ef5cf6f58e3055f67e823367aacf40e803..5d0fa622000bc8a1dab054d2d2e1e652686f8b27 100644 (file)
--- a/t/lei.t
+++ b/t/lei.t
@@ -149,7 +149,10 @@ my $test_fail = sub {
        for my $lk (qw(ei inbox)) {
                my $d = "$home/newline\n$lk";
                my $all = $lk eq 'ei' ? 'ALL' : 'all';
-               File::Path::mkpath("$d/$all.git/objects");
+               { # quiet newline warning on older Perls
+                       local $^W = undef if $^V lt v5.22.0;
+                       File::Path::mkpath("$d/$all.git/objects");
+               }
                open my $fh, '>', "$d/$lk.lock" or BAIL_OUT "open $d/$lk.lock";
                for my $fl (qw(-I --only)) {
                        ok(!lei('q', $fl, $d, 'whatever'),