comparison proxy_unfinished.t @ 319:e9de4da234c0

Tests: add version checks to TODOs for committed patches.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 25 Jul 2013 18:35:56 +0400
parents 81c98592661f
children e7dc8f4d0a4b
comparison
equal deleted inserted replaced
318:68b94b83412b 319:e9de4da234c0
97 97
98 http_get('/cache/length'); 98 http_get('/cache/length');
99 like(http_get('/cache/length'), qr/MISS/, 'unfinished not cached'); 99 like(http_get('/cache/length'), qr/MISS/, 'unfinished not cached');
100 100
101 TODO: { 101 TODO: {
102 local $TODO = 'not yet'; 102 local $TODO = 'not yet' unless $t->has_version('1.5.3');
103 103
104 # chunked encoding has enough information to don't cache a response, 104 # chunked encoding has enough information to don't cache a response,
105 # much like with Content-Length available 105 # much like with Content-Length available
106 106
107 http_get('/cache/chunked'); 107 http_get('/cache/chunked');
108 like(http_get('/cache/chunked'), qr/MISS/, 'unfinished chunked'); 108 like(http_get('/cache/chunked'), qr/MISS/, 'unfinished chunked');
109 109
110 } 110 }
111 111
112 TODO: { 112 TODO: {
113 local $TODO = 'not yet'; 113 local $TODO = 'not yet' unless $t->has_version('1.5.3');
114 114
115 # make sure there is no final chunk in unfinished responses 115 # make sure there is no final chunk in unfinished responses
116 116
117 like(http_get_11('/length'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s, 117 like(http_get_11('/length'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s,
118 'length no final chunk'); 118 'length no final chunk');
127 'length final chunk'); 127 'length final chunk');
128 like(http_get_11('/chunked/ok'), qr/finished.*\x0d\x0a?0\x0d\x0a?/s, 128 like(http_get_11('/chunked/ok'), qr/finished.*\x0d\x0a?0\x0d\x0a?/s,
129 'chunked final chunk'); 129 'chunked final chunk');
130 130
131 TODO: { 131 TODO: {
132 local $TODO = 'not yet'; 132 local $TODO = 'not yet' unless $t->has_version('1.5.3');
133 133
134 # the same with proxy_buffering set to off 134 # the same with proxy_buffering set to off
135 135
136 like(http_get_11('/un/length'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s, 136 like(http_get_11('/un/length'), qr/unfinished(?!.*\x0d\x0a?0\x0d\x0a?)/s,
137 'unbuffered length no final chunk'); 137 'unbuffered length no final chunk');
151 like(http_get('/big/ok', sleep => 0.1), qr/finished/s, 'big finished'); 151 like(http_get('/big/ok', sleep => 0.1), qr/finished/s, 'big finished');
152 like(http_get('/un/big', sleep => 0.1), qr/unfinished/s, 'big unfinished un'); 152 like(http_get('/un/big', sleep => 0.1), qr/unfinished/s, 'big unfinished un');
153 like(http_get('/un/big/ok', sleep => 0.1), qr/finished/s, 'big finished un'); 153 like(http_get('/un/big/ok', sleep => 0.1), qr/finished/s, 'big finished un');
154 154
155 TODO: { 155 TODO: {
156 local $TODO = 'not yet'; 156 local $TODO = 'not yet' unless $t->has_version('1.5.3');
157 157
158 # if disk buffering fails for some reason, there should be 158 # if disk buffering fails for some reason, there should be
159 # no final chunk 159 # no final chunk
160 160
161 chmod(0000, $t->testdir() . '/proxy_temp'); 161 chmod(0000, $t->testdir() . '/proxy_temp');