From fa6c9b965cec725942601d7bc40b6687c7b86ab7 Mon Sep 17 00:00:00 2001
From: Eric Wong <e@80x24.org>
Date: Thu, 24 Sep 2015 03:37:15 +0000
Subject: [PATCH] nntp: fix XOVER command

Oops, we need to test commands more closely :x
Add a missing prototype while we're at it for extra
checking.
---
 lib/PublicInbox/NNTP.pm | 4 ++--
 t/nntpd.t               | 9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 6dc0db35..0d0de976 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -762,11 +762,11 @@ sub cmd_xrover ($;$) {
 	});
 }
 
-sub over_line {
+sub over_line ($$) {
 	my ($self, $r) = @_;
 
 	more($self, join("\t", $r->[0], map {
-				my $h = xhdr($r, $_);
+				my $h = hdr_val($r, $_);
 				defined $h ? $h : '';
 			} @OVERVIEW ));
 }
diff --git a/t/nntpd.t b/t/nntpd.t
index 04444e48..ea2c3df8 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -144,7 +144,14 @@ EOF
 		}
 	}
 
-	# TODO: upgrades and such
+	is_deeply($n->xover('1-'), {
+		'1' => ['hihi',
+			'Me <me@example.com>',
+			'Thu, 01 Jan 1970 06:06:06 +0000',
+			'<nntp@example.com>',
+			'',
+			'202',
+			'1' ] }, "XOVER works");
 
 	ok(kill('TERM', $pid), 'killed nntpd');
 	$pid = undef;
-- 
2.51.0