Mercurial > hg > nginx-tests
changeset 1464:4bc1490cedbc
Tests: added $limit_rate test with invalid empty value.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 16 Apr 2019 17:12:06 +0300 |
parents | 5ac92857e419 |
children | 93633a10e33d |
files | http_variables.t |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/http_variables.t +++ b/http_variables.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(5); +my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(6); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -61,7 +61,7 @@ http { } location /limit_rate { - set $limit_rate 40k; + set $limit_rate $arg_l; add_header X-Rate $limit_rate; return 200 OK; } @@ -80,7 +80,8 @@ http_get('/redefine'); # $limit_rate is a special variable that has its own set_handler / get_handler -like(http_get('/limit_rate'), qr/X-Rate: 40960/, 'limit_rate handlers'); +like(http_get('/limit_rate?l=40k'), qr/X-Rate: 40960/, 'limit_rate handlers'); +like(http_get('/limit_rate'), qr/X-Rate: 0/, 'limit_rate invalid'); $t->stop();