user/dev discussion of public-inbox itself
 help / color / 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	[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	[flat|nested] 3+ messages in thread

end of thread, back to index

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

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror http://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git