$section = $matches[1]; print $line; continue; } if (preg_match('/^(\\d+\\.\\d+\\.\\d+)\\s*/', $line, $matches)) { $test = $matches[1]; if (in_array($test, $ignore)) { continue; } if (in_array($test, $longTests)) { $line = fgets($in); for ($line = fgets($in); !preg_match('/^\\s+\\|/', $line); $line = fgets($in)) { testLine($test, $line, $total, $success, $failed, $columns, $exceptions, $verbose); } } else { testLine($test, $line, $total, $success, $failed, $columns, $exceptions, $verbose); } } } if ($failed) { echo "\nFailed {$failed} tests.\n"; echo "UTF-8 DECODER TEST FAILED\n"; exit(-1); } echo "UTF-8 DECODER TEST SUCCESS!\n"; exit(0); function testLine($test, $line, &$total, &$success, &$failed, $columns, $exceptions, $verbose) { $stripped = $line; UtfNormal::quickisNFCVerify($stripped); $same = $line == $stripped;
$section = $matches[1]; print $line; continue; } if (preg_match('/^(\\d+\\.\\d+\\.\\d+)\\s*/', $line, $matches)) { $test = $matches[1]; if (in_array($test, $ignore)) { continue; } if (in_array($test, $longTests)) { $line = fgets($in); for ($line = fgets($in); !preg_match('/^\\s+\\|/', $line); $line = fgets($in)) { testLine($test, $line, $total, $success, $failed); } } else { testLine($test, $line, $total, $success, $failed); } } } if ($failed) { echo "\nFailed {$failed} tests.\n"; echo "UTF-8 DECODER TEST FAILED\n"; exit(-1); } echo "UTF-8 DECODER TEST SUCCESS!\n"; exit(0); function testLine($test, $line, &$total, &$success, &$failed) { $stripped = $line; UtfNormal::quickisNFCVerify($stripped); $same = $line == $stripped;