X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmbox_reader.t;fp=t%2Fmbox_reader.t;h=4ea2ae293a8ec8e4381bf9fd0ba91d8715c66644;hb=6dd3c17ed185c0ed4569541dae52e0570be4deca;hp=53458ec2fb2095763c5f2c0e6301d3d16eb037b4;hpb=0bd668ac6f15f791b626f5c644d23952c377b200;p=public-inbox.git diff --git a/t/mbox_reader.t b/t/mbox_reader.t index 53458ec2..4ea2ae29 100644 --- a/t/mbox_reader.t +++ b/t/mbox_reader.t @@ -72,4 +72,21 @@ for my $fmt (@mbox) { $check_fmt->($fmt) } s/\n/\r\n/sg for (values %raw); for my $fmt (@mbox) { $check_fmt->($fmt) } +SKIP: { + use PublicInbox::Spawn qw(popen_rd); + use Time::HiRes qw(alarm); + my $fh = popen_rd([ $^X, '-E', <<'' ]); +say "From x@y Fri Oct 2 00:00:00 1993"; +print "a: b\n\n", "x" x 70000, "\n\n"; +say "From x@y Fri Oct 2 00:00:00 2010"; +print "Final: bit\n\n", "Incomplete\n\n"; +exit 1 + + my @x; + eval { $reader->mboxrd($fh, sub { push @x, shift->as_string }) }; + like($@, qr/error closing mbox/, 'detects error reading from pipe'); + is(scalar(@x), 1, 'only saw one message'); + is(scalar(grep(/Final/, @x)), 0, 'no incomplete bit'); +} + done_testing;