Mercurial > hg > nginx-tests
comparison ssi_waited.t @ 148:b714d6df958c
Tests: rename some tests for better sorting.
Use underscore instead of dash. Addtionally, rename some tests to better
match "module" + "details" scheme used: use "http_" prefix for http core
module tests, use "mail_" prefix for mail module tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 04 Mar 2011 16:07:15 +0300 |
parents | ssi-waited.t@0d11b58d63bc |
children | c0ae29632905 |
comparison
equal
deleted
inserted
replaced
147:fd865ada95c8 | 148:b714d6df958c |
---|---|
1 #!/usr/bin/perl | |
2 | |
3 # (C) Maxim Dounin | |
4 | |
5 # Tests for nginx ssi module, waited subrequests. | |
6 | |
7 ############################################################################### | |
8 | |
9 use warnings; | |
10 use strict; | |
11 | |
12 use Test::More; | |
13 | |
14 BEGIN { use FindBin; chdir($FindBin::Bin); } | |
15 | |
16 use lib 'lib'; | |
17 use Test::Nginx; | |
18 | |
19 ############################################################################### | |
20 | |
21 select STDERR; $| = 1; | |
22 select STDOUT; $| = 1; | |
23 | |
24 my $t = Test::Nginx->new()->has(qw/http ssi/)->plan(2); | |
25 | |
26 $t->write_file_expand('nginx.conf', <<'EOF'); | |
27 | |
28 %%TEST_GLOBALS%% | |
29 | |
30 master_process off; | |
31 daemon off; | |
32 | |
33 events { | |
34 } | |
35 | |
36 http { | |
37 %%TEST_GLOBALS_HTTP%% | |
38 | |
39 server { | |
40 listen 127.0.0.1:8080; | |
41 server_name localhost; | |
42 location / { | |
43 ssi on; | |
44 } | |
45 } | |
46 } | |
47 | |
48 EOF | |
49 | |
50 $t->write_file('index.html', 'x<!--#include virtual="/first.html" -->' . | |
51 'x<!--#include virtual="/second.html" -->x'); | |
52 $t->write_file('first.html', 'FIRST'); | |
53 $t->write_file('second.html', | |
54 '<!--#include virtual="/waited.html" wait="yes"-->xSECOND'); | |
55 $t->write_file('waited.html', 'WAITED'); | |
56 | |
57 $t->run(); | |
58 | |
59 ############################################################################### | |
60 | |
61 like(http_get('/'), qr/^xFIRSTxWAITEDxSECONDx$/m, 'waited non-active'); | |
62 | |
63 like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); | |
64 | |
65 ############################################################################### |