com php-src: Add test for #64529: sapi/cli/tests/bug64529.phpt
| From: | Xinchen Hui | Date: | Thu, 28 Mar 2013 05:45:42 +0000 |
| Subject: | com php-src: Add test for #64529: sapi/cli/tests/bug64529.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71779@lists.php.net to get a copy of this message | ||
Commit: 467cd6a60f2909c14e5273e3fd4a98953779a5b8
Author: Xinchen Hui <laruence@php.net> Thu, 28 Mar 2013 13:45:42 +0800
Parents: 1182a3356c6c1989a686aab5258e1d47c56b2955
Branches: PHP-5.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=467cd6a60f2909c14e5273e3fd4a98953779a5b8
Log:
Add test for #64529
Bugs:
https://bugs.php.net/64529
Changed paths:
A sapi/cli/tests/bug64529.phpt
Diff:
diff --git a/sapi/cli/tests/bug64529.phpt b/sapi/cli/tests/bug64529.phpt
new file mode 100644
index 0000000..0c2d0e1
--- /dev/null
+++ b/sapi/cli/tests/bug64529.phpt
@@ -0,0 +1,62 @@
+--TEST--
+Bug #64529 (Ran out of opcode space)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test");
+if (!trim(
which expect)) die "skip no expect installed";
+?>
+--FILE--
+<?php
+$expect_executable = trim(which expect);
+$php_executable = getenv('TEST_PHP_EXECUTABLE');
+$script = __DIR__ . "/expect.sh";
+
+if (extension_loaded("readline")) {
+ $expect_script = <<<SCRIPT
+
+set php_executable [lindex \$argv 0]
+
+spawn \$php_executable -n -a
+
+expect "php >"
+
+send "echo 'hello world';\n"
+send "\04"
+
+expect eof
+
+exit
+
+SCRIPT;
+
+} else {
+ $expect_script = <<<SCRIPT
+
+set php_executable [lindex \$argv 0]
+
+spawn \$php_executable -n -a
+
+expect "Interactive mode enabled"
+
+send "<?php echo 'hello world';\n"
+send "\04"
+
+expect eof
+
+exit
+
+SCRIPT;
+}
+
+file_put_contents($script, $expect_script);
+
+system($expect_executable . " " . $script . " " . $php_executable);
+
+@unlink($script);
+?>
+--EXPECTF--
+spawn %sphp -n -a
+Interactive %s
+
+%secho 'hello world';
+hello worl%s