diff options
author | Eric Wong <e@80x24.org> | 2015-09-30 21:00:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-09-30 21:09:25 +0000 |
commit | 58c7600f8fc4d9970793a214c22cab52540968f7 (patch) | |
tree | 9f2b34311122944f8581a118ec873108c5afadb3 /t | |
parent | bb93ee6601ac6ca5fb6ff0e9d4d1cfcbb73e7f58 (diff) | |
download | public-inbox-58c7600f8fc4d9970793a214c22cab52540968f7.tar.gz |
More testing is good, especially since clients I use don't implement all the commands.
Diffstat (limited to 't')
-rw-r--r-- | t/nntpd.t | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -176,6 +176,25 @@ EOF is($r[2], '.', 'correctly terminated response'); } + is_deeply($n->xhdr(qw(Cc 1-)), { 1 => 'test-nntpd@example.com' }, + 'XHDR Cc 1- works'); + is_deeply($n->xhdr(qw(References 1-)), { 1 => '' }, + 'XHDR References 1- works (empty string)'); + is_deeply($n->xhdr(qw(list-id 1-)), {}, + 'XHDR on invalid header returns empty'); + + { + syswrite($s, "HDR List-id 1-\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'); + } + ok(kill('TERM', $pid), 'killed nntpd'); $pid = undef; waitpid(-1, 0); |