diff options
Diffstat (limited to 't')
-rw-r--r-- | t/basic.t | 30 |
1 files changed, 20 insertions, 10 deletions
@@ -5,7 +5,7 @@ use Apache::Test; use Apache::TestUtil; use Apache::TestRequest qw/GET_BODY/; -BEGIN { plan tests => 7; } +BEGIN { plan tests => 9; } # Prepare environment @@ -50,15 +50,6 @@ overwrite 't/htdocs/test.html', @body; ok GET_BODY('/test.html'), "${body[0]}$head${body[1]}$foot", '<head>-ful head'; -overwrite 't/htdocs/subdir/.htaccess', <<CONF; -Inject head.html -CONF - -@body = ("This is a test page.\n"); -overwrite 't/htdocs/subdir/test.html', @body; -ok GET_BODY('/subdir/test.html'), "$head${body[0]}", - 'different injection in subdirectory'; - @body = ("<html>\n", "This is a test page.\n", "</html>\n"); overwrite 't/htdocs/test.html', @body; ok GET_BODY('/test.html'), "${body[0]}$head${body[1]}$foot${body[2]}", @@ -74,6 +65,25 @@ overwrite 't/htdocs/test.html', @body; ok GET_BODY('/test.html'), "${body[0]}$head${body[1]}$foot", '<!doctype> with leading newline'; +@body = ("<!-- quirks mode -->\n<!doctype html><!-- test -->\n", "This is a test page.\n"); +overwrite 't/htdocs/test.html', @body; +ok GET_BODY('/test.html'), "${body[0]}$head${body[1]}$foot", + 'comments in <head>'; + +@body = ("<body>\n", "This is a test page.\n"); +overwrite 't/htdocs/test.html', @body; +ok GET_BODY('/test.html'), "${body[0]}$head${body[1]}$foot", + 'document with <body>'; + +overwrite 't/htdocs/subdir/.htaccess', <<CONF; +Inject head.html +CONF + +@body = ("This is a test page.\n"); +overwrite 't/htdocs/subdir/test.html', @body; +ok GET_BODY('/subdir/test.html'), "$head${body[0]}", + 'different injection in subdirectory'; + overwrite 't/htdocs/.htaccess', <<CONF; Inject - head.html CONF |