user/dev discussion of public-inbox itself
 help / Atom feed
* [PATCH 1/3] nntp: add test case for the "DATE" command
       [not found] <20161213034815.30324-1-e@80x24.org>
@ 2016-12-13  3:48 ` Eric Wong
  0 siblings, 0 replies; 1+ messages in thread
From: Eric Wong @ 2016-12-13  3:48 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply	[flat|threaded] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20161213034815.30324-1-e@80x24.org>
2016-12-13  3:48 ` [PATCH 1/3] nntp: add test case for the "DATE" command Eric Wong

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.org/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox