* [PATCH] t/lei.t: quiet newline warning on older Perls
@ 2023-06-08 18:26 7% Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2023-06-08 18:26 UTC (permalink / raw)
To: meta
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 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/lei.t b/t/lei.t
index a80143ef..5d0fa622 100644
--- 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'),
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-06-08 18:26 7% [PATCH] t/lei.t: quiet newline warning on older Perls Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).