Mercurial > hg > nginx-tests
changeset 1060:a07205e8bb76
Tests: added "nginx -T" tests for unique dumped files.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 19 Oct 2016 17:59:03 +0300 |
parents | 8c5ba361b416 |
children | 83357211563e |
files | config_dump.t |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/config_dump.t Mon Oct 17 19:59:37 2016 +0300 +++ b/config_dump.t Wed Oct 19 17:59:03 2016 +0300 @@ -25,13 +25,14 @@ my $t = Test::Nginx->new()->has(qw/http map/); -$t->plan(10)->write_file_expand('nginx.conf', <<'EOF'); +$t->plan(13)->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% daemon off; include %%TESTDIR%%/inc.conf; +include %%TESTDIR%%/inc.conf; events { } @@ -43,6 +44,7 @@ default 0; foo bar; include map.conf; + include map.conf; } upstream u { @@ -75,6 +77,15 @@ like($dump, qr!^# configuration file $d/inc2.conf:$!m, 'inc2.conf found'); like($dump, qr!^# configuration file $d/map.conf:$!m, 'map.conf found'); +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.11.6'); + +unlike($dump, qr!(# configuration file $d/inc.conf:).*\1!s, 'inc.conf uniq'); +unlike($dump, qr!(# configuration file $d/inc2.conf:).*\1!s, 'inc2.conf uniq'); +unlike($dump, qr!(# configuration file $d/map.conf:).*\1!s, 'map.conf uniq'); + +} + is(getconf($t, $dump, 'nginx.conf'), $t->read_file('nginx.conf'), 'content'); is(getconf($t, $dump, 'inc.conf'), $t->read_file('inc.conf'), 'content inc'); is(getconf($t, $dump, 'map.conf'), $t->read_file('map.conf'), 'content inc 2');