Tests: index module tests merged.
diff --git a/index.t b/index.t
index c8f6dde..bc8263f 100644
--- a/index.t
+++ b/index.t
@@ -22,7 +22,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http/)->plan(7)
+my $t = Test::Nginx->new()->has(qw/http/)->plan(8)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -67,6 +67,13 @@
index $server_name.html;
}
+ location /va2/ {
+ alias %%TESTDIR%%/;
+ # before 1.13.8, the token produced emerg:
+ # directive "index" is not terminated by ";"
+ index ${server_name}.html;
+ }
+
location /var_redirect/ {
index /$server_name.html;
}
@@ -90,6 +97,7 @@
like(http_get('/loop/'), qr/500 Internal/, 'redirect loop');
like(http_get('/many/'), qr/X-URI: \/many\/many.html.*manybody/ms, 'many');
like(http_get('/var/'), qr/X-URI: \/var\/localhost.html.*varbody/ms, 'var');
+like(http_get('/va2/'), qr/X-URI: \/va2\/localhost.html.*varbody/ms, 'var 2');
like(http_get('/var_redirect/'), qr/X-URI: \/localhost.html.*varbody/ms,
'var with redirect');
diff --git a/index2.t b/index2.t
deleted file mode 100644
index f335cc3..0000000
--- a/index2.t
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/perl
-
-# (C) Sergey Kandaurov
-# (C) Nginx, Inc.
-
-# Tests for index module, which is a helper for testing
-# configuration token that starts with a variable.
-
-###############################################################################
-
-use warnings;
-use strict;
-
-use Test::More;
-
-BEGIN { use FindBin; chdir($FindBin::Bin); }
-
-use lib 'lib';
-use Test::Nginx;
-
-###############################################################################
-
-select STDERR; $| = 1;
-select STDOUT; $| = 1;
-
-my $t = Test::Nginx->new()->has(qw/http/)->plan(1)
- ->write_file_expand('nginx.conf', <<'EOF');
-
-%%TEST_GLOBALS%%
-
-daemon off;
-
-events {
-}
-
-http {
- %%TEST_GLOBALS_HTTP%%
-
- server {
- listen 127.0.0.1:8080;
- server_name localhost;
- add_header X-URI $uri;
-
- location /var/ {
- alias %%TESTDIR%%/;
- index ${server_name}html;
- }
- }
-}
-
-EOF
-
-$t->write_file('localhosthtml', 'varbody');
-
-$t->run();
-
-###############################################################################
-
-like(http_get('/var/'), qr/X-URI: \/var\/localhosthtml.*varbody/ms, 'var');
-
-###############################################################################