changeset 94:9ab3762332b9

Tests: chunked tests for unbuffered and inmemory proxy. Note that while these two modes currently use the same filter function they are quite different. Only one continuous buffer (u->buffer) used for subrequest_in_memory and this means that chunk-data should be concatenated somehow (memmove?).
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 10 May 2009 03:53:20 +0400
parents 1d3c82227a05
children cbc17561ef4d
files proxy-chunked.t
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/proxy-chunked.t
+++ b/proxy-chunked.t
@@ -13,7 +13,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 1;
+use Test::More tests => 3;
 
 use IO::Select;
 
@@ -53,11 +53,22 @@ http {
             proxy_pass http://127.0.0.1:8081;
             proxy_read_timeout 1s;
         }
+        location /nobuffering {
+            proxy_pass http://127.0.0.1:8081;
+            proxy_read_timeout 1s;
+            proxy_buffering off;
+        }
+        location /inmemory.html {
+            ssi on;
+        }
     }
 }
 
 EOF
 
+$t->write_file('inmemory.html',
+	'<!--#include virtual="/" set="one" --><!--#echo var="one" -->');
+
 $t->run_daemon(\&http_chunked_daemon);
 $t->run();
 
@@ -67,6 +78,8 @@ EOF
 local $TODO = 'not yet';
 
 like(http_get('/'), qr/\x0d\x0aSEE-THIS$/s, 'chunked');
+like(http_get('/nobuffering'), qr/\x0d\x0aSEE-THIS$/s, 'chunked nobuffering');
+like(http_get('/inmemory.html'), qr/\x0d\x0aSEE-THIS$/s, 'chunked inmemory');
 }
 
 ###############################################################################