pajoye Mon, 25 Jan 2010 13:49:47 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=293977
Log:
- make it work on win, simplify expect using expectf
Changed paths:
U
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49847.phpt
U
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49847.phpt
U php/php-src/trunk/ext/standard/tests/general_functions/bug49847.phpt
Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49847.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49847.phpt 2010-01-25 13:23:32 UTC (rev 293976)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49847.phpt 2010-01-25 13:49:47 UTC (rev 293977)
@@ -2,11 +2,24 @@
Bug #49847 (exec() fails on lines larger then 4095 bytes)
--FILE--
<?php
-exec("printf %4098d 1", $output);
+$iswin = substr(PHP_OS, 0, 3) == "WIN";
+
+if ($iswin) {
+ $f = dirname(__FILE__) . '\\bug49847.tmp';
+ $s = str_repeat(' ', 4097);
+ $s .= '1';
+ file_put_contents($f, $s);
+ exec('more ' . $f, $output);
+} else {
+ exec("printf %4098d 1", $output);
+}
var_dump($output);
+if ($iswin) {
+ unlink($f);
+}
?>
---EXPECT--
+--EXPECTF--
array(1) {
[0]=>
- string(4098) " 1"
+ string(4098) "%s 1"
}
Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49847.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49847.phpt 2010-01-25 13:23:32 UTC (rev 293976)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49847.phpt 2010-01-25 13:49:47 UTC (rev 293977)
@@ -2,11 +2,24 @@
Bug #49847 (exec() fails on lines larger then 4095 bytes)
--FILE--
<?php
-exec("printf %4098d 1", $output);
+$iswin = substr(PHP_OS, 0, 3) == "WIN";
+
+if ($iswin) {
+ $f = dirname(__FILE__) . '\\bug49847.tmp';
+ $s = str_repeat(' ', 4097);
+ $s .= '1';
+ file_put_contents($f, $s);
+ exec('more ' . $f, $output);
+} else {
+ exec("printf %4098d 1", $output);
+}
var_dump($output);
+if ($iswin) {
+ unlink($f);
+}
?>
---EXPECT--
+--EXPECTF--
array(1) {
[0]=>
- string(4098) " 1"
+ string(4098) "%s 1"
}
Modified: php/php-src/trunk/ext/standard/tests/general_functions/bug49847.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/bug49847.phpt 2010-01-25 13:23:32 UTC (rev 293976)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug49847.phpt 2010-01-25 13:49:47 UTC (rev 293977)
@@ -2,11 +2,24 @@
Bug #49847 (exec() fails on lines larger then 4095 bytes)
--FILE--
<?php
-exec("printf %4098d 1", $output);
+$iswin = substr(PHP_OS, 0, 3) == "WIN";
+
+if ($iswin) {
+ $f = dirname(__FILE__) . '\\bug49847.tmp';
+ $s = str_repeat(' ', 4097);
+ $s .= '1';
+ file_put_contents($f, $s);
+ exec('more ' . $f, $output);
+} else {
+ exec("printf %4098d 1", $output);
+}
var_dump($output);
+if ($iswin) {
+ unlink($f);
+}
?>
---EXPECT--
+--EXPECTF--
array(1) {
[0]=>
- string(4098) " 1"
+ string(4098) "%s 1"
}
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
