Mercurial > hg > nginx-tests
changeset 192:f2a48c528b3b
Tests: fixed http variables test, log entries order may differ.
author | Valentin Bartenev <ne@vbart.ru> |
---|---|
date | Thu, 29 Dec 2011 18:31:14 +0300 |
parents | bc6ecf23cc9c |
children | 50063559d85a |
files | http_variables.t |
diffstat | 1 files changed, 12 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/http_variables.t Mon Dec 26 14:49:21 2011 +0300 +++ b/http_variables.t Thu Dec 29 18:31:14 2011 +0300 @@ -36,7 +36,7 @@ http { %%TEST_GLOBALS_HTTP%% - log_format cc "CC: $sent_http_cache_control"; + log_format cc "$uri: $sent_http_cache_control"; server { listen 127.0.0.1:8080; @@ -73,25 +73,24 @@ $t->stop(); -my @log; +my $log; -open LOG, $t->testdir() . '/cc.log' - or die("Can't open nginx access log file.\n"); - -foreach my $line (<LOG>) { - chomp $line; - push @log, $line; +{ + open LOG, $t->testdir() . '/cc.log' + or die("Can't open nginx access log file.\n"); + local $/; + $log = <LOG>; + close LOG; } -close LOG; - -is(shift @log, 'CC: -', 'no header'); -is(shift @log, 'CC: max-age=3600; private; must-revalidate', 'multi headers'); +like($log, qr!^/: -$!m, 'no header'); +like($log, qr!^/set: max-age=3600; private; must-revalidate$!m, + 'multi headers'); TODO:{ local $TODO = 'add hash checks'; -is(shift @log, 'CC: no-cache', 'ignoring headers with (hash == 0)'); +like($log, qr!^/redefine: no-cache$!m, 'ignoring headers with (hash == 0)'); } ###############################################################################