comparison proxy_unfinished.t @ 589:a9569f57da98

Tests: whitespaces fix.
author Andrey Zelenkov <zelenkov@nginx.com>
date Mon, 25 May 2015 18:42:34 +0300
parents 2cd00179f4b2
children 153969b53780
comparison
equal deleted inserted replaced
588:53b7c3c33a79 589:a9569f57da98
117 'chunked final chunk'); 117 'chunked final chunk');
118 118
119 # the same with proxy_buffering set to off 119 # the same with proxy_buffering set to off
120 120
121 like(http_get_11('/un/length'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s, 121 like(http_get_11('/un/length'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s,
122 'unbuffered length no final chunk'); 122 'unbuffered length no final chunk');
123 like(http_get_11('/un/chunked'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s, 123 like(http_get_11('/un/chunked'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s,
124 'unbuffered chunked no final chunk'); 124 'unbuffered chunked no final chunk');
125 125
126 like(http_get_11('/un/length/ok'), qr/finished.*\x0d\x0a?0\x0d\x0a?/s, 126 like(http_get_11('/un/length/ok'), qr/finished.*\x0d\x0a?0\x0d\x0a?/s,
127 'unbuffered length final chunk'); 127 'unbuffered length final chunk');
128 like(http_get_11('/un/chunked/ok'), qr/finished.*\x0d\x0a?0\x0d\x0a?/s, 128 like(http_get_11('/un/chunked/ok'), qr/finished.*\x0d\x0a?0\x0d\x0a?/s,
129 'unbuffered chunked final chunk'); 129 'unbuffered chunked final chunk');
130 130
131 # big responses 131 # big responses
132 132
133 like(http_get('/big', sleep => 0.1), qr/unfinished/s, 'big unfinished'); 133 like(http_get('/big', sleep => 0.1), qr/unfinished/s, 'big unfinished');
134 like(http_get('/big/ok', sleep => 0.1), qr/finished/s, 'big finished'); 134 like(http_get('/big/ok', sleep => 0.1), qr/finished/s, 'big finished');
188 "Cache-Control: max-age=300" . CRLF . 188 "Cache-Control: max-age=300" . CRLF .
189 "Connection: close" . CRLF . 189 "Connection: close" . CRLF .
190 CRLF . 190 CRLF .
191 "unfinished" . CRLF; 191 "unfinished" . CRLF;
192 192
193 } elsif ($uri eq '/length/ok') { 193 } elsif ($uri eq '/length/ok') {
194 print $client 194 print $client
195 "HTTP/1.1 200 OK" . CRLF . 195 "HTTP/1.1 200 OK" . CRLF .
196 "Content-Length: 10" . CRLF . 196 "Content-Length: 10" . CRLF .
197 "Cache-Control: max-age=300" . CRLF . 197 "Cache-Control: max-age=300" . CRLF .
198 "Connection: close" . CRLF . 198 "Connection: close" . CRLF .
199 CRLF . 199 CRLF .
200 "finished" . CRLF; 200 "finished" . CRLF;
201 201
202 } elsif ($uri eq '/big') { 202 } elsif ($uri eq '/big') {
203 print $client 203 print $client
204 "HTTP/1.1 200 OK" . CRLF . 204 "HTTP/1.1 200 OK" . CRLF .
205 "Content-Length: 1000100" . CRLF . 205 "Content-Length: 1000100" . CRLF .
206 "Cache-Control: max-age=300" . CRLF . 206 "Cache-Control: max-age=300" . CRLF .
207 "Connection: close" . CRLF . 207 "Connection: close" . CRLF .
209 for (1 .. 10000) { 209 for (1 .. 10000) {
210 print $client ("X" x 98) . CRLF; 210 print $client ("X" x 98) . CRLF;
211 } 211 }
212 print $client "unfinished" . CRLF; 212 print $client "unfinished" . CRLF;
213 213
214 } elsif ($uri eq '/big/ok') { 214 } elsif ($uri eq '/big/ok') {
215 print $client 215 print $client
216 "HTTP/1.1 200 OK" . CRLF . 216 "HTTP/1.1 200 OK" . CRLF .
217 "Content-Length: 1000010" . CRLF . 217 "Content-Length: 1000010" . CRLF .
218 "Cache-Control: max-age=300" . CRLF . 218 "Cache-Control: max-age=300" . CRLF .
219 "Connection: close" . CRLF . 219 "Connection: close" . CRLF .
240 "Cache-Control: max-age=300" . CRLF . 240 "Cache-Control: max-age=300" . CRLF .
241 "Connection: close" . CRLF . 241 "Connection: close" . CRLF .
242 CRLF . 242 CRLF .
243 "a" . CRLF . 243 "a" . CRLF .
244 "finished" . CRLF . 244 "finished" . CRLF .
245 CRLF . "0" . CRLF . CRLF; 245 CRLF . "0" . CRLF . CRLF;
246 } 246 }
247 } 247 }
248 } 248 }
249 249
250 ############################################################################### 250 ###############################################################################