X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv2writable.t;h=0d1022047d49b8853a8e6a9370e3b960c5efde95;hb=d3c6f8e57b15e8d3de0431c8419bdd0497ec3d32;hp=f0fa8a79548daaca8ff120697dfd3b699204756a;hpb=860169adcd29341142b7c4a369c09b4ac492bd1e;p=public-inbox.git diff --git a/t/v2writable.t b/t/v2writable.t index f0fa8a79..0d102204 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -17,6 +17,7 @@ my $ibx = { inboxdir => $inboxdir, name => 'test-v2writable', version => 2, + -no_fsync => 1, -primary_address => 'test@example.com', }; $ibx = PublicInbox::Inbox->new($ibx); @@ -148,7 +149,7 @@ SELECT COUNT(*) FROM over WHERE num > 0 } { - use Net::NNTP; + require_mods('Net::NNTP', 1); my $err = "$inboxdir/stderr.log"; my $out = "$inboxdir/stdout.log"; my $group = 'inbox.comp.test.v2writable'; @@ -282,6 +283,22 @@ EOF is($msgs->[1]->{mid}, 'y'x244, 'stored truncated mid(2)'); } +if ('UTF-8 References') { + my @w; + local $SIG{__WARN__} = sub { push @w, @_ }; + my $msg = < +References: <\xc4\x80\@example> + +EOM + ok($im->add(PublicInbox::Eml->new($msg."a\n")), 'UTF-8 References 1'); + ok($im->add(PublicInbox::Eml->new($msg."b\n")), 'UTF-8 References 2'); + $im->done; + ok(!grep(/Wide character/, @w), 'no wide characters') or xbail(\@w); +} + my $tmp = { inboxdir => "$inboxdir/non-existent/subdir", name => 'nope', @@ -307,7 +324,7 @@ ok($@, 'V2Writable fails on non-existent dir'); open $fh, '<', $alt or die $!; my $before = do { local $/; <$fh> }; - ok($v2w->git_init(3), 'init a new epoch'); + ok($v2w->{mg}->add_epoch(3), 'init a new epoch'); open $fh, '<', $alt or die $!; my $after = do { local $/; <$fh> }; ok(index($after, $before) > 0,