* [PATCH 4/5] t/nntpd.t: stop hard coding message :bytes into test
2016-05-02 18:01 5% [PATCH 0/5] miscellaneous minor changes Eric Wong
@ 2016-05-02 18:01 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-05-02 18:01 UTC (permalink / raw)
To: meta
It limits flexibility and makes it harder to switch
to use PublicImport::Import.
---
t/nntpd.t | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/t/nntpd.t b/t/nntpd.t
index d033221..b026bd5 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -46,6 +46,7 @@ my %opts = (
);
my $sock = IO::Socket::INET->new(%opts);
my $pid;
+my $len;
END { kill 'TERM', $pid if defined $pid };
{
local $ENV{HOME} = $home;
@@ -69,6 +70,8 @@ EOF
IPC::Run::run([$mda], \$in);
is(0, $?, 'ran MDA correctly');
is(0, system($index, $maindir), 'indexed git dir');
+ $simple->header_set('List-Id', "<$addr>");
+ $len = length($simple->as_string);
}
ok($sock, 'sock created');
@@ -151,7 +154,7 @@ EOF
'Thu, 01 Jan 1970 06:06:06 +0000',
'<nntp@example.com>',
'',
- '202',
+ $len,
'1' ] }, "XOVER range works");
is_deeply($n->xover('1'), {
@@ -160,7 +163,7 @@ EOF
'Thu, 01 Jan 1970 06:06:06 +0000',
'<nntp@example.com>',
'',
- '202',
+ $len,
'1' ] }, "XOVER by article works");
{
@@ -173,7 +176,7 @@ EOF
like($r[0], qr/^224 /, 'got 224 response for OVER');
is($r[1], "0\thihi\tMe <me\@example.com>\t" .
"Thu, 01 Jan 1970 06:06:06 +0000\t" .
- "$mid\t\t202\t1", 'OVER by Message-ID works');
+ "$mid\t\t$len\t1", 'OVER by Message-ID works');
is($r[2], '.', 'correctly terminated response');
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] miscellaneous minor changes
@ 2016-05-02 18:01 5% Eric Wong
2016-05-02 18:01 7% ` [PATCH 4/5] t/nntpd.t: stop hard coding message :bytes into test Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-05-02 18:01 UTC (permalink / raw)
To: meta
Subject threading is now disabled completely to hopefully
expose misuse (or broken) email clients. NNTP messages
now include HTTP/HTTPS archive headers, and there's some
minor test improvements with more to come.
Eric Wong (5):
http: remove needless binmode call
view: disable subject threading
nntp: append Archived-At and List-Archive headers
t/nntpd.t: stop hard coding message :bytes into test
t/*.t: reduce -mda calls
lib/PublicInbox/HTTP.pm | 1 -
lib/PublicInbox/NNTP.pm | 27 +++++++++++++++++++++++++--
lib/PublicInbox/NNTPD.pm | 3 ++-
lib/PublicInbox/NewsGroup.pm | 11 ++++++++++-
lib/PublicInbox/SearchView.pm | 17 +++++++----------
lib/PublicInbox/Thread.pm | 14 ++++++++++++++
lib/PublicInbox/View.pm | 16 +++-------------
t/cgi.t | 41 +++++++++++++++++------------------------
t/httpd.t | 22 +++++++++-------------
t/nntp.t | 34 ++++++++++++++++++++++++++++++++++
t/nntpd.t | 31 ++++++++++++++-----------------
t/plack.t | 43 +++++++++++++------------------------------
12 files changed, 148 insertions(+), 112 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 --
2016-05-02 18:01 5% [PATCH 0/5] miscellaneous minor changes Eric Wong
2016-05-02 18:01 7% ` [PATCH 4/5] t/nntpd.t: stop hard coding message :bytes into test 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).