Mercurial > hg > nginx-tests
comparison xslt_params.t @ 392:c28ecaef065f
Tests: try_run() introduced.
This method replaces multiple ad-hoc solutions to grecefully skip tests if
nginx startup fails, e.g., due to no support for a particular directive.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 18 Apr 2014 18:36:26 +0400 |
parents | 6a0d934950bc |
children | 847ea345becb |
comparison
equal
deleted
inserted
replaced
391:915ef26ac6eb | 392:c28ecaef065f |
---|---|
84 | 84 |
85 $t->write_file('x1', '<root>data</root>'); | 85 $t->write_file('x1', '<root>data</root>'); |
86 $t->write_file('x2', '<root>data</root>'); | 86 $t->write_file('x2', '<root>data</root>'); |
87 $t->write_file('x3', '<root>data</root>'); | 87 $t->write_file('x3', '<root>data</root>'); |
88 | 88 |
89 eval { | 89 $t->try_run('no xslt_param')->plan(3); |
90 open OLDERR, ">&", \*STDERR; close STDERR; | |
91 $t->run(); | |
92 open STDERR, ">&", \*OLDERR; | |
93 }; | |
94 | |
95 plan(skip_all => 'no xslt_param') if $@; | |
96 $t->plan(3); | |
97 | 90 |
98 ############################################################################### | 91 ############################################################################### |
99 | 92 |
100 like(http_get("/x1"), qr!200 OK.*param1=value1.*param2=data.*param3=value3!ms, | 93 like(http_get("/x1"), qr!200 OK.*param1=value1.*param2=data.*param3=value3!ms, |
101 'params from xslt_stylesheet'); | 94 'params from xslt_stylesheet'); |