1--TEST--
2readline_write_history(): Basic test
3--EXTENSIONS--
4readline
5--SKIPIF--
6<?php if (!function_exists('readline_add_history')) die("skip");
7if (READLINE_LIB != "libedit") die("skip libedit only");
8if(substr(PHP_OS, 0, 3) != 'WIN' ) {
9    die('skip windows only test');
10}
11?>
12--FILE--
13<?php
14
15$name = tempnam(sys_get_temp_dir(), 'readline.tmp');
16
17readline_add_history('foo');
18readline_add_history('');
19readline_add_history(1);
20readline_write_history($name);
21
22var_dump(file_get_contents($name));
23
24unlink($name);
25
26?>
27--EXPECT--
28string(6) "foo
291
30"
31