# HG changeset patch # User Sergey Kandaurov # Date 1476889143 -10800 # Node ID a07205e8bb76ce5a0624a14b301d5ead1fba75d0 # Parent 8c5ba361b416227d547c456ff1e4a1f6f117736b Tests: added "nginx -T" tests for unique dumped files. diff --git a/config_dump.t b/config_dump.t --- a/config_dump.t +++ b/config_dump.t @@ -25,13 +25,14 @@ select STDOUT; $| = 1; 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 @@ http { default 0; foo bar; include map.conf; + include map.conf; } upstream u { @@ -75,6 +77,15 @@ like($dump, qr!^# configuration file $d/ 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');