mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Add test for #64529
This commit is contained in:
parent
1182a3356c
commit
467cd6a60f
62
sapi/cli/tests/bug64529.phpt
Normal file
62
sapi/cli/tests/bug64529.phpt
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user