]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/nntpd.t
index: account for CRLF conversion when storing bytes
[public-inbox.git] / t / nntpd.t
index 69f72ce12163ef453f8171a3494b23b326b7cdf8..d2f313231159cc7df01942b869fc8b82b9f07190 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -53,7 +53,7 @@ $ibx = PublicInbox::Inbox->new($ibx);
        my $len;
 
        $ibx = PublicInbox::InboxWritable->new($ibx);
-       my $im = $ibx->importer;
+       my $im = $ibx->importer(0);
 
        # ensure successful message delivery
        {
@@ -73,7 +73,10 @@ EOF
                my $list_id = $addr;
                $list_id =~ s/@/./;
                $mime->header_set('List-Id', "<$list_id>");
-               $len = length($mime->as_string);
+               my $str = $mime->as_string;
+               $str =~ s/(?<!\r)\n/\r\n/sg;
+               $len = length($str);
+               undef $str;
                $im->add($mime);
                $im->done;
                if ($version == 1) {