cvs: php-src /ext/standard/tests/file bug38086.phpt

From: Date: Fri, 15 Aug 2008 19:33:43 +0000
Subject: cvs: php-src /ext/standard/tests/file bug38086.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-52398@lists.php.net to get a copy of this message
pajoye Fri Aug 15 19:33:43 2008 UTC Modified files: /php-src/ext/standard/tests/file bug38086.phpt Log: - make it portable without loosing pertinent data http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug38086.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/standard/tests/file/bug38086.phpt diff -u php-src/ext/standard/tests/file/bug38086.phpt:1.2 php-src/ext/standard/tests/file/bug38086.phpt:1.3 --- php-src/ext/standard/tests/file/bug38086.phpt:1.2 Tue May 27 09:34:52 2008 +++ php-src/ext/standard/tests/file/bug38086.phpt Fri Aug 15 19:33:43 2008 @@ -2,6 +2,7 @@ Bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length) --FILE-- <?php +define('WIN', substr(PHP_OS, 0, 3) == 'WIN'); $initial_file = dirname(__FILE__).'/bug38086.txt'; $new_file = dirname(__FILE__).'/bug38086_1.txt'; @@ -13,7 +14,11 @@ var_dump(stream_copy_to_stream($src, $dest)); fclose($src); fclose($dest); -var_dump(file_get_contents($new_file)); +if (WIN) { + var_dump(str_replace("\r\n","\n", file_get_contents($new_file))); +} else { + var_dump(file_get_contents($new_file)); +} unlink($new_file); $src = fopen($initial_file, 'r'); @@ -23,20 +28,24 @@ var_dump(stream_copy_to_stream($src, $dest, 10000)); fclose($src); fclose($dest); -var_dump(file_get_contents($new_file)); +if (WIN) { + var_dump(str_replace("\r\n","\n", file_get_contents($new_file))); +} else { + var_dump(file_get_contents($new_file)); +} unlink($new_file); echo "Done\n"; ?> ---EXPECT-- -int(134) +--EXPECTF-- +int(%d) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " -int(134) +int(%d) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf

« previous php.cvs (#52398) next »