mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
fork test
This commit is contained in:
parent
d7a1b243da
commit
e1c3df3e88
29
ext/readline/tests/libedit_write_history_001-win32.phpt
Normal file
29
ext/readline/tests/libedit_write_history_001-win32.phpt
Normal file
@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
readline_write_history(): Basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("readline") || !function_exists('readline_add_history')) die("skip");
|
||||
if (READLINE_LIB != "libedit") die("skip libedit only");
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$name = tempnam(sys_get_temp_dir(), 'readline.tmp');
|
||||
|
||||
readline_add_history('foo');
|
||||
readline_add_history('');
|
||||
readline_add_history(1);
|
||||
readline_add_history(NULL);
|
||||
readline_write_history($name);
|
||||
|
||||
var_dump(file_get_contents($name));
|
||||
|
||||
unlink($name);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foo
|
||||
1
|
||||
"
|
@ -3,6 +3,9 @@ readline_write_history(): Basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("readline") || !function_exists('readline_add_history')) die("skip");
|
||||
if (READLINE_LIB != "libedit") die("skip libedit only");
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' ) {
|
||||
die('skip not for windows');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
Loading…
Reference in New Issue
Block a user