helly Wed Nov 30 19:57:30 2005 EDT
Modified files:
/php-src run-tests.php
Log:
- White space fixes
http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.240&r2=1.241&ty=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.240 php-src/run-tests.php:1.241
--- php-src/run-tests.php:1.240 Wed Nov 30 19:26:44 2005
+++ php-src/run-tests.php Wed Nov 30 19:57:29 2005
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php,v 1.240 2005/12/01 00:26:44 helly Exp $ */
+/* $Id: run-tests.php,v 1.241 2005/12/01 00:57:29 helly Exp $ */
/* Sanity check to ensure that pcre extension needed by this script is
available.
* In the event it is not, print a nice error message indicating that this
script will
@@ -1135,63 +1135,63 @@
} else { // normal testing
- // Does the output match what is expected?
- $output = trim($out);
- $output = preg_replace('/\r\n/',"\n",$output);
-
- /* when using CGI, strip the headers from the output */
- if (isset($old_php) && ($pos = strpos($output, "\n\n")) !== FALSE) {
- $output = substr($output, ($pos + 2));
- }
-
- 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);
- if (isset($section_text['EXPECTF'])) {
- $wanted_re = preg_quote($wanted_re, '/');
- // Stick to basics
- $wanted_re = str_replace("%e", '\\' .
DIRECTORY_SEPARATOR, $wanted_re);
- $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]*(E-?[0-9]+)?", $wanted_re);
- $wanted_re = str_replace("%c", ".", $wanted_re);
- // %f allows two points "-.0.0" but that is the best
*simple* expression
+ // Does the output match what is expected?
+ $output = trim($out);
+ $output = preg_replace('/\r\n/',"\n",$output);
+
+ /* when using CGI, strip the headers from the output */
+ if (isset($old_php) && ($pos = strpos($output, "\n\n")) !==
FALSE) {
+ $output = substr($output, ($pos + 2));
}
+
+ 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);
+ if (isset($section_text['EXPECTF'])) {
+ $wanted_re = preg_quote($wanted_re, '/');
+ // Stick to basics
+ $wanted_re = str_replace("%e", '\\' .
DIRECTORY_SEPARATOR, $wanted_re);
+ $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]*(E-?[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_re);
print(str_repeat('=', 80) . "\n");
var_dump($output);
*/
- if (preg_match("/^$wanted_re\$/s", $output)) {
- @unlink($tmp_file);
- show_result("PASS", $tested, $file);
- if (isset($old_php)) {
- $php = $old_php;
+ if (preg_match("/^$wanted_re\$/s", $output)) {
+ @unlink($tmp_file);
+ show_result("PASS", $tested, $file);
+ if (isset($old_php)) {
+ $php = $old_php;
+ }
+ return 'PASSED';
}
- return 'PASSED';
- }
- } else {
- $wanted = trim($section_text['EXPECT']);
- $wanted = preg_replace('/\r\n/',"\n",$wanted);
- // compare and leave on success
- $ok = (0 == strcmp($output,$wanted));
- if ($ok) {
- @unlink($tmp_file);
- show_result("PASS", $tested, $file);
- if (isset($old_php)) {
- $php = $old_php;
+ } else {
+ $wanted = trim($section_text['EXPECT']);
+ $wanted = preg_replace('/\r\n/',"\n",$wanted);
+ // compare and leave on success
+ $ok = (0 == strcmp($output,$wanted));
+ if ($ok) {
+ @unlink($tmp_file);
+ show_result("PASS", $tested, $file);
+ if (isset($old_php)) {
+ $php = $old_php;
+ }
+ return 'PASSED';
}
- return 'PASSED';
+ $wanted_re = NULL;
}
- $wanted_re = NULL;
- }
} //end of non-valgrind testing
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php