From: Eric Wong <e@80x24.org>
Date: Wed, 30 Sep 2015 21:00:26 +0000 (+0000)
Subject: t/nntpd.t: simplify condition for response termination
X-Git-Tag: v1.0.0~814
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bb93ee6601ac6ca5fb6ff0e9d4d1cfcbb73e7f58;p=public-inbox.git

t/nntpd.t: simplify condition for response termination

Multiline responses must end with "\r\n.\r\n", so we won't
break out early in case the OS doesn't support MSG_MORE.
---

diff --git a/t/nntpd.t b/t/nntpd.t
index e4c0244d..8a721e20 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -130,7 +130,7 @@ EOF
 		syswrite($s, "HDR $k $mid\r\n");
 		do {
 			sysread($s, $buf, 4096, length($buf));
-		} until ($buf =~ /^[^2]../ || $buf =~ /\r\n\.\r\n\z/);
+		} until ($buf =~ /\r\n\.\r\n\z/);
 		my @r = split("\r\n", $buf);
 		like($r[0], qr/\A224 /, '224 response for HDR');
 		is($r[1], "0 $v", 'got expected response for HDR');
@@ -167,7 +167,7 @@ EOF
 		$buf = '';
 		do {
 			sysread($s, $buf, 4096, length($buf));
-		} until ($buf =~ /^[^2]../ || $buf =~ /\r\n\.\r\n\z/);
+		} until ($buf =~ /\r\n\.\r\n\z/);
 		my @r = split("\r\n", $buf);
 		like($r[0], qr/^224 /, 'got 224 response for OVER');
 		is($r[1], "0\thihi\tMe <me\@example.com>\t" .