]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/convert-compact: avoid warning on `scalar(split(...))'
authorEric Wong <e@yhbt.net>
Fri, 1 May 2020 18:04:45 +0000 (18:04 +0000)
committerEric Wong <e@yhbt.net>
Sun, 3 May 2020 09:29:29 +0000 (09:29 +0000)
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

index ae29902123c6f12ca8e6bf8c01cabfafe5b11f10..1627e0195b5219cd73008cb5e5e87f678db25078 100644 (file)
@@ -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();