]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/nntpd.t
mda: set List-ID correctly according to RFC2919
[public-inbox.git] / t / nntpd.t
index 7192d7819dd6d12e9a758581da373042cc39091b..2ccc90fbad785254516f6c26c9e93e223e7abdda 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -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);
@@ -202,6 +204,14 @@ EOF
        is_deeply($n->xhdr(qw(list-id 1-)), {},
                 'XHDR on invalid header returns empty');
 
+       {
+               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-');