# HG changeset patch # User Sergey Kandaurov # Date 1431525465 -10800 # Node ID 517cde5075d8b79aa8ca788a0dd497d197a1a003 # Parent ca54b445d9826c0e4212aef87da9f0ebc7430469 Tests: improved time zone name checks for $date_gmt in ssi.t. Time zone name format is implementation defined, and, e.g., on win32 it may contain spaces, such as "Pacific Standard Time" for PST. While here, catch this in headers as well. diff --git a/ssi.t b/ssi.t --- a/ssi.t +++ b/ssi.t @@ -70,15 +70,15 @@ http { } location /var { ssi on; - add_header X-Var $date_gmt; + add_header X-Var x${date_gmt}x; } location /var_noformat { ssi on; - add_header X-Var $date_gmt; + add_header X-Var x${date_gmt}x; return 200; } location /var_nossi { - add_header X-Var $date_gmt; + add_header X-Var x${date_gmt}x; return 200; } } @@ -172,20 +172,18 @@ like(http_get('/unescape3.html'), qr/404 # handling of embedded date variables -like(http_get('/var_nossi.html'), - qr/X-Var: \w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d \w+/, 'no ssi'); -like(http_get('/var_noformat.html'), - qr/X-Var: \w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d \w+/, 'no format'); +my $re_date_gmt = qr/X-Var: x\w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d [\w ]+x/; -like(http_get('/var_format.html?custom=1'), - qr/X-Var: \w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d \w+/, 'custom header'); -like(http_get('/var_format.html'), - qr/X-Var: \w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d \w+/, 'default header'); +like(http_get('/var_nossi.html'), $re_date_gmt, 'no ssi'); +like(http_get('/var_noformat.html'), $re_date_gmt, 'no format'); + +like(http_get('/var_format.html?custom=1'), $re_date_gmt, 'custom header'); +like(http_get('/var_format.html'), $re_date_gmt, 'default header'); like(http_get('/var_format.html?custom=1'), qr/x\w+, \d\d:\d\d:\d\dx/, 'custom ssi'); like(http_get('/var_format.html'), - qr/x\w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d \w+x/, 'default ssi'); + qr/x\w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d [\w ]+x/, 'default ssi'); like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts');