X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fnntpd.t;h=2815d8d641694073b2a62ee852735303c77c15ea;hb=4f0b09919ae9c8823bf6c1fa1452bc27945952a3;hp=5f4ba57ba0c3b89bc0fe7e6b528ba723f50b9ef7;hpb=3f779258173530ca88f31e1dc5332f951d2c44cd;p=public-inbox.git
diff --git a/t/nntpd.t b/t/nntpd.t
index 5f4ba57b..2815d8d6 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -1,5 +1,5 @@
-# Copyright (C) 2015 all contributors
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2015-2018 all contributors
+# License: AGPL-3.0+
use strict;
use warnings;
use Test::More;
@@ -62,7 +62,9 @@ Content-Transfer-Encoding: 8bit
This is a test message for El\xc3\xa9anor
EOF
- $mime->header_set('List-Id', "<$addr>");
+ my $list_id = $addr;
+ $list_id =~ s/@/./;
+ $mime->header_set('List-Id', "<$list_id>");
$len = length($mime->as_string);
my $git = PublicInbox::Git->new($maindir);
my $im = PublicInbox::Import->new($git, 'test', $addr);
@@ -175,6 +177,8 @@ EOF
is_deeply($n->head(1), $n->head(''), 'HEAD OK');
is_deeply($n->body(1), $n->body(''), 'BODY OK');
+ is($n->body(1)->[0], "This is a test message for El\xc3\xa9anor\n",
+ 'body really matches');
my $art = $n->article(1);
is(ref($art), 'ARRAY', 'got array for ARTICLE');
is_deeply($art, $n->article(''), 'ARTICLE OK');
@@ -200,6 +204,16 @@ EOF
is_deeply($n->xhdr(qw(list-id 1-)), {},
'XHDR on invalid header returns empty');
+ my $mids = $n->newnews(0, '*');
+ is_deeply($mids, [''], 'NEWNEWS works');
+ {
+ my $t0 = time;
+ my $date = $n->date;
+ my $t1 = time;
+ ok($date >= $t0, 'valid date after start');
+ ok($date <= $t1, 'valid date before stop');
+ }
+
{
setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1);
syswrite($s, 'HDR List-id 1-');
@@ -217,6 +231,7 @@ EOF
is(scalar @r, 1, 'only one response line');
}
+ $n = $s = undef;
is($pid, waitpid($pid, 0), 'nntpd exited successfully');
my $eout = eval {
local $/;