summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-10-26 16:54:30 +0000
committerMarcus Boerger <helly@php.net>2002-10-26 16:54:30 +0000
commitcc4c0634fe1bd33eabe7c5fe9004082a6822d23a (patch)
treec4b2e189f54ff80e8f096ccb070ab3000442d7a2 /run-tests.php
parent0679a9139fb02dcf409e58c2af4b45584570cf7a (diff)
downloadphp-git-cc4c0634fe1bd33eabe7c5fe9004082a6822d23a.tar.gz
-introduce EXPECTREGEX
-add %c for EXPECTF #i think we must escape the special characters for EXPECTF: ".()" and such
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/run-tests.php b/run-tests.php
index 841c0b0d6f..cda58ec9a9 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -559,17 +559,24 @@ COMMAND $cmd
$output = trim($out);
$output = preg_replace('/\r\n/',"\n",$output);
- if (isset($section_text['EXPECTF'])) {
- $wanted = trim($section_text['EXPECTF']);
+ if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) {
+ if (isset($section_text['EXPECTF'])) {
+ $wanted = trim($section_text['EXPECTF']);
+ } else {
+ $wanted = trim($section_text['EXPECTREGEX']);
+ }
$wanted_re = preg_replace('/\r\n/',"\n",$wanted);
- $wanted_re = preg_quote($wanted_re, '/');
- // Stick to basics
- $wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy
- $wanted_re = str_replace("%i", "[+\-]?[0-9]+", $wanted_re);
- $wanted_re = str_replace("%d", "[0-9]+", $wanted_re);
- $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re);
- $wanted_re = str_replace("%f", "[+\-]?\.?[0-9]+\.?[0-9]*", $wanted_re);
- // %f allows two points "-.0.0" but that is the best *simple* expression
+ if (isset($section_text['EXPECTF'])) {
+ $wanted_re = preg_quote($wanted_re, '/');
+ // Stick to basics
+ $wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy
+ $wanted_re = str_replace("%i", "[+\-]?[0-9]+", $wanted_re);
+ $wanted_re = str_replace("%d", "[0-9]+", $wanted_re);
+ $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re);
+ $wanted_re = str_replace("%f", "[+\-]?\.?[0-9]+\.?[0-9]*", $wanted_re);
+ $wanted_re = str_replace("%c", ".", $wanted_re);
+ // %f allows two points "-.0.0" but that is the best *simple* expression
+ }
/* DEBUG YOUR REGEX HERE
var_dump($wanted);
print(str_repeat('=', 80) . "\n");