+ is_deeply($n->xhdr(qw(Cc 1-)), { 1 => 'test-nntpd@example.com' },
+ 'XHDR Cc 1- works');
+ is_deeply($n->xhdr(qw(References 1-)), { 1 => '<reftabsqueezed>' },
+ 'XHDR References 1- works)');
+ is_deeply($n->xhdr(qw(list-id 1-)), {},
+ 'XHDR on invalid header returns empty');
+
+ my $mids = $n->newnews(0, '*');
+ is_deeply($mids, ['<nntp@example.com>'], 'NEWNEWS works');
+ {
+ 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-');
+ select(undef, undef, undef, 0.15);
+ ok(kill('TERM', $pid), 'killed nntpd');
+ select(undef, undef, undef, 0.15);
+ syswrite($s, "\r\n");
+ $buf = '';
+ do {
+ sysread($s, $buf, 4096, length($buf));
+ } until ($buf =~ /\r\n\z/);
+ my @r = split("\r\n", $buf);
+ like($r[0], qr/^5\d\d /,
+ 'got 5xx response for unoptimized HDR');
+ is(scalar @r, 1, 'only one response line');
+ }
+
+ $n = $s = undef;
+ is($pid, waitpid($pid, 0), 'nntpd exited successfully');
+ my $eout = eval {
+ local $/;
+ open my $fh, '<', $err or die "open $err failed: $!";
+ <$fh>;
+ };
+ is($?, 0, 'no error in exited process');
+ unlike($eout, qr/wide/i, 'no Wide character warnings');