From: Eric Wong Date: Tue, 13 Dec 2016 03:10:11 +0000 (+0000) Subject: nntp: add test case for the "DATE" command X-Git-Tag: v1.0.0~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed15c484cdc3daec5abe224a349c083ec3b2db53;p=thirdparty%2Fpublic-inbox.git nntp: add test case for the "DATE" command We may not always use strftime and may implement caching. But for now, just add a test. --- diff --git a/t/nntpd.t b/t/nntpd.t index 7192d7819..ad50a64fd 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -202,6 +202,14 @@ EOF is_deeply($n->xhdr(qw(list-id 1-)), {}, 'XHDR on invalid header returns empty'); + { + 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-');