unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/2] tests: Perl 5.10.1 fixes
@ 2020-05-01 18:04 Eric Wong
  2020-05-01 18:04 ` [PATCH 1/2] t/httpd-corner.t: fix uninitialized warning Eric Wong
  2020-05-01 18:04 ` [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))' Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
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	[flat|nested] 3+ messages in thread

* [PATCH 1/2] t/httpd-corner.t: fix uninitialized warning
  2020-05-01 18:04 [PATCH 0/2] tests: Perl 5.10.1 fixes Eric Wong
@ 2020-05-01 18:04 ` Eric Wong
  2020-05-01 18:04 ` [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))' Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2020-05-01 18:04 UTC (permalink / raw)
  To: meta

Current versions of Perl don't warn when vec() is given `undef'
as its first arg, but Perl 5.10.1 does, at least.

Fixes: c7b4cbdadf3116a0 ("t/httpd-corner: improve reliability and diagnostics")
---
 t/httpd-corner.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index 7a6bcc66..68148655 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -296,7 +296,7 @@ my $len = length $str;
 is($len, 26, 'got the alphabet');
 my $check_self = sub {
 	my ($conn) = @_;
-	vec(my $rbits, fileno($conn), 1) = 1;
+	vec(my $rbits = '', fileno($conn), 1) = 1;
 	select($rbits, undef, undef, 30) or Carp::confess('timed out');
 	$conn->read(my $buf, 4096);
 	my ($head, $body) = split(/\r\n\r\n/, $buf, 2);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))'
  2020-05-01 18:04 [PATCH 0/2] tests: Perl 5.10.1 fixes Eric Wong
  2020-05-01 18:04 ` [PATCH 1/2] t/httpd-corner.t: fix uninitialized warning Eric Wong
@ 2020-05-01 18:04 ` Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-01 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 18:04 [PATCH 0/2] tests: Perl 5.10.1 fixes Eric Wong
2020-05-01 18:04 ` [PATCH 1/2] t/httpd-corner.t: fix uninitialized warning Eric Wong
2020-05-01 18:04 ` [PATCH 2/2] t/convert-compact: avoid warning on `scalar(split(...))' Eric Wong

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).