- Fix .exp output

This commit is contained in:
Derick Rethans 2002-10-08 17:51:57 +00:00
parent 6882bdc24b
commit 4fcc3df5eb

View File

@ -409,18 +409,18 @@ COMMAND $cmd
if (isset($section_text['EXPECTF'])) { if (isset($section_text['EXPECTF'])) {
$wanted = trim($section_text['EXPECTF']); $wanted = trim($section_text['EXPECTF']);
$wanted = preg_replace('/\r\n/',"\n",$wanted); $wanted_re = preg_replace('/\r\n/',"\n",$wanted);
$wanted = preg_quote($wanted, '/'); $wanted_re = preg_quote($wanted_re, '/');
// Stick to basics // Stick to basics
$wanted = str_replace("%s", ".*?", $wanted); //not greedy $wanted_re = str_replace("%s", ".*?", $wanted_re); //not greedy
$wanted = str_replace("%i", "[0-9]+", $wanted); $wanted_re = str_replace("%i", "[0-9]+", $wanted_re);
$wanted = str_replace("%f", "[0-9\.+\-]+", $wanted); $wanted_re = str_replace("%f", "[0-9\.+\-]+", $wanted_re);
/* DEBUG YOUR REGEX HERE /* DEBUG YOUR REGEX HERE
var_dump($wanted); var_dump($wanted);
print(str_repeat('=', 80) . "\n"); print(str_repeat('=', 80) . "\n");
var_dump($output); var_dump($output);
*/ */
if (preg_match("/$wanted/s", $output)) { if (preg_match("/$wanted_re/s", $output)) {
echo "PASS $tested\n"; echo "PASS $tested\n";
return 'PASSED'; return 'PASSED';
} }