]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2writable.t
t/nntpd: reduce dependencies on internal API
[public-inbox.git] / t / v2writable.t
index cdcfe4d0680029a1d1bb329ff5c0a81cc8316a56..8897062abfd04a2d8dbf51da5a2a16fc74145628 100644 (file)
@@ -48,7 +48,7 @@ my $git0;
 if ('ensure git configs are correct') {
        my @cmd = (qw(git config), "--file=$inboxdir/all.git/config",
                qw(core.sharedRepository 0644));
-       is(system(@cmd), 0, "set sharedRepository in all.git");
+       is(xsys(@cmd), 0, "set sharedRepository in all.git");
        $git0 = PublicInbox::Git->new("$inboxdir/git/0.git");
        chomp(my $v = $git0->qx(qw(config core.sharedRepository)));
        is($v, '0644', 'child repo inherited core.sharedRepository');
@@ -109,6 +109,11 @@ if ('ensure git configs are correct') {
        @mids = $mime->header_obj->header_raw('Message-Id');
        like($mids[0], $sane_mid, 'mid was generated');
        is(scalar(@mids), 1, 'new generated');
+
+       @warn = ();
+       $mime->header_set('Message-Id', '<space@ (NXDOMAIN) >');
+       ok($im->add($mime), 'message added with space in Message-Id');
+       is_deeply([], \@warn);
 }
 
 {
@@ -175,8 +180,13 @@ EOF
                is($uniq{$mid}++, 0, "MID for $num is unique in XOVER");
                is_deeply($n->xhdr('Message-ID', $num),
                         { $num => $mid }, "XHDR lookup OK on num $num");
+
+               # FIXME PublicInbox::NNTP (server) doesn't handle spaces in
+               # Message-ID, but neither does Net::NNTP (client)
+               next if $mid =~ / /;
+
                is_deeply($n->xhdr('Message-ID', $mid),
-                        { $mid => $mid }, "XHDR lookup OK on MID $num");
+                        { $mid => $mid }, "XHDR lookup OK on MID $mid ($num)");
        }
        my %nn;
        foreach my $mid (@{$n->newnews(0, $group)}) {