# HG changeset patch # User Valentin Bartenev # Date 1347377354 -14400 # Node ID 62114a0c13896f1bb83410fb9544bcf5488d0706 # Parent 1a5574d8491742bbde5c52c32af54f6f4cbe5b96 Tests: skip ssi if regex tests without the rewrite module. diff --git a/ssi_if.t b/ssi_if.t --- a/ssi_if.t +++ b/ssi_if.t @@ -95,19 +95,28 @@ like(http_get('/if_neq.html?v=notequal') like(http_get('/if_neq.html?v=equal'), qr/^xx$/m, 'if text != var (false)'); -$t->write_file('if_eq_re.html', - 'xOKx'); +SKIP: { + # PCRE may not be available unless we have rewrite module + + skip 'no PCRE', 4 unless $t->has_module('rewrite'); -like(http_get('/if_eq_re.html?v=XreeeegexX'), qr/^xOKx$/m, 'if var = /regex/'); -like(http_get('/if_eq_re.html?v=XrgxX'), qr/^xx$/m, 'if var = /regex/ (false)'); + $t->write_file('if_eq_re.html', + 'xOKx'); + + like(http_get('/if_eq_re.html?v=XreeeegexX'), qr/^xOKx$/m, + 'if var = /regex/'); + like(http_get('/if_eq_re.html?v=XrgxX'), qr/^xx$/m, + 'if var = /regex/ (false)'); -$t->write_file('if_neq_re.html', - 'xOKx'); + $t->write_file('if_neq_re.html', + 'xOKx'); -like(http_get('/if_neq_re.html?v=XrgxX'), qr/^xOKx$/m, 'if var != /regex/'); -like(http_get('/if_neq_re.html?v=XreeeegexX'), qr/^xx$/m, - 'if var != /regex/ (false)'); + like(http_get('/if_neq_re.html?v=XrgxX'), qr/^xOKx$/m, + 'if var != /regex/'); + like(http_get('/if_neq_re.html?v=XreeeegexX'), qr/^xx$/m, + 'if var != /regex/ (false)'); +} $t->write_file('if_varvar.html', @@ -117,22 +126,28 @@ like(http_get('/if_varvar.html?v=varHERE 'if var = complex'); -$t->write_file('if_cap_re.html', - 'x' - . 'x' - . 'x'); +SKIP: { + # PCRE may not be available unless we have rewrite module + + skip 'no PCRE', 2 unless $t->has_module('rewrite'); -like(http_get('/if_cap_re.html?v=hereCAP1andCAP2'), qr/^xCAP1xCAP2x$/m, - 'if regex with captures'); + $t->write_file('if_cap_re.html', + 'x' + . 'x' + . 'x'); + + like(http_get('/if_cap_re.html?v=hereCAP1andCAP2'), qr/^xCAP1xCAP2x$/m, + 'if regex with captures'); -$t->write_file('if_ncap_re.html', - 'x' - . '' - . 'x'); + $t->write_file('if_ncap_re.html', + 'x' + . '' + . 'x'); -like(http_get('/if_ncap_re.html?v=captureHEREeee'), qr/^xHEREx$/m, - 'if regex with named capture'); + like(http_get('/if_ncap_re.html?v=captureHEREeee'), qr/^xHEREx$/m, + 'if regex with named capture'); +} $t->write_file('if.html', 'x' . $if_elif_else . 'x');