changeset 1684:e7f0b4ca0a1a

Tests: literals support in IMAP test backend.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 19 May 2021 04:33:09 +0300
parents 994d1b58cbe8
children 869b312c214e
files lib/Test/Nginx/IMAP.pm
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/Test/Nginx/IMAP.pm
+++ b/lib/Test/Nginx/IMAP.pm
@@ -125,6 +125,17 @@ sub imap_test_daemon {
 		print $client "* OK fake imap server ready" . CRLF;
 
 		while (<$client>) {
+			Test::Nginx::log_core('||', $_);
+
+			while (m/{(\d+)}\x0d?$/) {
+				print $client '+ ' . CRLF;
+				$client->sysread(my $buf, $1);
+				Test::Nginx::log_core('||', $buf);
+				$buf = <$client>;
+				Test::Nginx::log_core('||', $buf);
+				$_ .= $buf;
+			}
+
 			my $tag = '';
 
 			$tag = $1 if m/^(\S+)/;