]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: fix XOVER command
authorEric Wong <e@80x24.org>
Thu, 24 Sep 2015 03:37:15 +0000 (03:37 +0000)
committerEric Wong <e@80x24.org>
Thu, 24 Sep 2015 06:58:05 +0000 (06:58 +0000)
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
t/nntpd.t

index 6dc0db35e16f86885ba735be3008cfb6f1e4d3b9..0d0de976f562454c0c3443eed3c95cbbf6a9f6b7 100644 (file)
@@ -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 ));
 }
index 04444e488e835bef1f07f1eb112b10801c8d4fd9..ea2c3df882b7c1ff267c9ddb78456c697ed00d0b 100644 (file)
--- 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;