* [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))'
2020-05-01 18:04 5% [PATCH 0/2] tests: Perl 5.10.1 fixes Eric Wong
@ 2020-05-01 18:04 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-05-01 18:04 UTC (permalink / raw)
To: meta
Perl 5.10.1 would warn about implicit assignment to @_ by
split(). So favor the documented method of using `tr'
to count lines.
Fixes: b5ddcb3352ef31ae ("index: support --compact / -c on command-line")
---
t/convert-compact.t | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/convert-compact.t b/t/convert-compact.t
index ae299021..1627e019 100644
--- a/t/convert-compact.t
+++ b/t/convert-compact.t
@@ -124,7 +124,6 @@ $rdr->{2} = \(my $err2 = '');
$cmd = [ qw(-index --reindex -cc), "$tmpdir/v2" ];
ok(run_script($cmd, undef, $rdr), '--reindex -c -c');
like($err2, qr/xapian-compact/, 'xapian-compact ran (-c -c)');
-ok(scalar(split(/\n/, $err2)) > scalar(split(/\n/, $err)),
- '-compacted twice');
+ok(($err2 =~ tr/\n/\n/) > ($err =~ tr/\n/\n/), '-compacted twice');
done_testing();
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] tests: Perl 5.10.1 fixes
@ 2020-05-01 18:04 5% Eric Wong
2020-05-01 18:04 7% ` [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))' Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-05-01 18:04 UTC (permalink / raw)
To: meta
Oops, I only tested as far back as 5.16.3 last release :x
Oh well, seems pretty harmless.
Eric Wong (2):
t/httpd-corner.t: fix uninitialized warning
t/convert-compact: avoid warning on `scalar(split(...))'
t/convert-compact.t | 3 +--
t/httpd-corner.t | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-05-01 18:04 5% [PATCH 0/2] tests: Perl 5.10.1 fixes Eric Wong
2020-05-01 18:04 7% ` [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))' 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).