summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2009-03-12 20:42:46 +0000
committerZoe Slattery <zoe@php.net>2009-03-12 20:42:46 +0000
commit1df58d629aad75ef6df21b9cb222fe005b124dfb (patch)
tree67051fe4544b8974fad34a72f4082a351f918a65
parentcc34210c3279193cc378980be601a3a5da756459 (diff)
downloadphp-git-1df58d629aad75ef6df21b9cb222fe005b124dfb.tar.gz
refixing %r in run-tests.php (thanks iain lewis for the fix)
-rwxr-xr-xrun-tests.php52
1 files changed, 26 insertions, 26 deletions
diff --git a/run-tests.php b/run-tests.php
index 004d10d397..26ac65b937 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1738,32 +1738,32 @@ COMMAND $cmd
if (isset($section_text['EXPECTF'])) {
- // do preg_quote, but miss out any %r delimited sections
- $temp = "";
- $r = "%r";
- $startOffset = 0;
- $length = strlen($wanted_re);
- while($startOffset < $length) {
- $start = strpos($wanted_re, $r, $startOffset);
- if ($start !== false) {
- // we have found a start tag
- $end = strpos($wanted_re, $r, $start+2);
- if ($end === false) {
- // unbalanced tag, ignore it.
- $end = $start = $length;
- }
- } else {
- // no more %r sections
- $start = $end = $length;
- }
- // quote a non re portion of the string
- $temp = $temp . preg_quote(substr($wanted_re, $startOffset, ($start - $startOffset)), '/');
- // add the re unquoted.
- $temp = $temp . substr($wanted_re, $start+2, ($end - $start-2));
- $startOffset = $end + 2;
- }
- $wanted_re = $temp;
-
+ // do preg_quote, but miss out any %r delimited sections
+ $temp = "";
+ $r = "%r";
+ $startOffset = 0;
+ $length = strlen($wanted_re);
+ while($startOffset < $length) {
+ $start = strpos($wanted_re, $r, $startOffset);
+ if ($start !== false) {
+ // we have found a start tag
+ $end = strpos($wanted_re, $r, $start+2);
+ if ($end === false) {
+ // unbalanced tag, ignore it.
+ $end = $start = $length;
+ }
+ } else {
+ // no more %r sections
+ $start = $end = $length;
+ }
+ // quote a non re portion of the string
+ $temp = $temp . preg_quote(substr($wanted_re, $startOffset, ($start - $startOffset)), '/');
+ // add the re unquoted.
+ $temp = $temp . '(' . substr($wanted_re, $start+2, ($end - $start-2)). ')';
+ $startOffset = $end + 2;
+ }
+ $wanted_re = $temp;
+
$wanted_re = str_replace(
array('%binary_string_optional%'),
version_compare(PHP_VERSION, '6.0.0-dev') == -1 ? 'string' : 'binary string',