From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 18F4D206A4 for ; Tue, 13 Dec 2016 03:48:17 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] nntp: add test case for the "DATE" command Date: Tue, 13 Dec 2016 03:48:13 +0000 Message-Id: <20161213034815.30324-2-e@80x24.org> In-Reply-To: <20161213034815.30324-1-e@80x24.org> References: <20161213034815.30324-1-e@80x24.org> List-Id: We may not always use strftime and may implement caching. But for now, just add a test. --- t/nntpd.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/nntpd.t b/t/nntpd.t index 7192d78..ad50a64 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -203,6 +203,14 @@ EOF '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-'); select(undef, undef, undef, 0.15); -- EW