Mercurial > hg > nginx-tests
diff proxy_variables.t @ 1410:a1a3164faec8
Tests: harden proxy_variables.t, avoid uninitialized warnings.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 04 Dec 2018 17:07:18 +0300 |
parents | 3783b937a1dc |
children | 16a8962ff246 |
line wrap: on
line diff
--- a/proxy_variables.t Mon Dec 03 16:43:56 2018 +0300 +++ b/proxy_variables.t Tue Dec 04 17:07:18 2018 +0300 @@ -22,7 +22,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(22) +my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(24) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -138,10 +138,13 @@ TODO: { local $TODO = 'not yet' unless $t->has_version('1.15.7'); -cmp_ok($ct3, '<', 1, 'connect time log - client close'); +isnt($ct3, '-', 'connect time log - client close set'); } +$ct3 = 0 if $ct3 eq '-'; +cmp_ok($ct3, '<', 1, 'connect time log - client close'); + cmp_ok($ht, '>=', 1, 'header time log - slow response header'); cmp_ok($ht2, '<', 1, 'header time log - slow response body'); is($ht3, '-', 'header time log - client close'); @@ -152,6 +155,8 @@ TODO: { local $TODO = 'not yet' unless $t->has_version('1.15.7'); +isnt($rt3, '-', 'response time log - client close set'); +$rt3 = 0 if $rt3 eq '-'; cmp_ok($rt3, '>', $ct3, 'response time log - client close'); }