From: Steph Fox Date: Thu, 12 Jun 2008 12:02:01 +0000 (+0000) Subject: - Tidy up loose ends in diff and exp output X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1538 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e39a404fefa12ca09f5ed5b2d47e05a738667f96;p=php - Tidy up loose ends in diff and exp output - All test output now has *nix line endings (only diffs didn't in 5_3) --- diff --git a/run-tests.php b/run-tests.php index 69e0eb4d32..ec8e5e4393 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1783,7 +1783,7 @@ COMMAND $cmd if (!$passed) { // write .exp - if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, $wanted) === false) { + if (strpos($log_format, 'E') !== false && file_put_contents($exp_filename, (binary)$wanted, FILE_BINARY) === false) { error("Cannot create expected test output - $exp_filename"); } @@ -1796,7 +1796,7 @@ COMMAND $cmd $diff = generate_diff($wanted, $wanted_re, $output); show_file_block('diff', $diff); - if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff) === false) { + if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, (binary)$diff, FILE_BINARY) === false) { error("Cannot create test diff - $diff_filename"); } @@ -2008,10 +2008,10 @@ function generate_diff($wanted, $wanted_re, $output) $diff = generate_array_diff($r, $o, !is_null($wanted_re), $w); if (is_binary($output)) { - return implode(b"\r\n", $diff); + return implode(b"\n", $diff); } - return implode("\r\n", $diff); + return implode("\n", $diff); } function error($message)