* [PATCH 12/12] t/nntpd.t: additional tests for XHDR/HDR
2015-09-30 21:00 5% [PATCH 0/12] another round of NNTP updates Eric Wong
@ 2015-09-30 21:00 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-09-30 21:00 UTC (permalink / raw)
To: meta
More testing is good, especially since clients I use
don't implement all the commands.
---
t/nntpd.t | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/t/nntpd.t b/t/nntpd.t
index 8a721e2..ecb876f 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -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);
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/12] another round of NNTP updates
@ 2015-09-30 21:00 5% Eric Wong
2015-09-30 21:00 7% ` [PATCH 12/12] t/nntpd.t: additional tests for XHDR/HDR Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-09-30 21:00 UTC (permalink / raw)
To: meta
This is probably performant enough for practical use :)
Eric Wong (12):
search: remove get_subject_path
nntp: HDR returns 225, not 224
nntp: reduce syscalls for LIST OVERVIEW.FMT
remove unnecessary fields usage
daemon: always autoflush stdout/stderr
nntpd: avoid lazy require
INSTALL: document Danga::Socket dependency for nntpd
nntp: MODE READER denies posting
nntp: implement LIST HEADERS
nntp: implement OVER/XOVER summary in search document
t/nntpd.t: simplify condition for response termination
t/nntpd.t: additional tests for XHDR/HDR
INSTALL | 2 +
lib/PublicInbox/Daemon.pm | 3 +
lib/PublicInbox/GitCatFile.pm | 5 +-
lib/PublicInbox/Hval.pm | 9 +--
lib/PublicInbox/Mbox.pm | 11 ++-
lib/PublicInbox/Msgmap.pm | 4 +-
lib/PublicInbox/NNTP.pm | 175 ++++++++++++++++++++----------------------
lib/PublicInbox/NewsGroup.pm | 25 +++---
lib/PublicInbox/Search.pm | 43 ++++++++---
lib/PublicInbox/SearchIdx.pm | 59 ++++++++++----
lib/PublicInbox/SearchMsg.pm | 86 +++++++++++++--------
lib/PublicInbox/SearchView.pm | 19 ++---
public-inbox-nntpd | 19 +++--
t/nntpd.t | 46 ++++++++++-
t/search.t | 2 +-
15 files changed, 305 insertions(+), 203 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-30 21:00 5% [PATCH 0/12] another round of NNTP updates Eric Wong
2015-09-30 21:00 7% ` [PATCH 12/12] t/nntpd.t: additional tests for XHDR/HDR Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).