felipe          Fri Nov 21 21:44:11 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/readline/tests 
                                readline_callback_handler_install_001.phpt 
                                readline_callback_handler_remove_001.phpt 
                                readline_read_history_001.phpt 
  Log:
  - New tests
  

http://cvs.php.net/viewvc.cgi/php-src/ext/readline/tests/readline_callback_handler_install_001.phpt?view=markup&rev=1.1
Index: php-src/ext/readline/tests/readline_callback_handler_install_001.phpt
+++ php-src/ext/readline/tests/readline_callback_handler_install_001.phpt
--TEST--
readline_callback_handler_install(): Basic test
--FILE--
<?php

function foo() {
        readline_callback_handler_remove();
}

var_dump(readline_callback_handler_install('testing: ', 'foo'));
var_dump(readline_callback_handler_install('testing: ', 'foobar!'));
var_dump(readline_callback_handler_install('testing: '));

?>
--EXPECTF--
testing: bool(true)

Warning: readline_callback_handler_install(): foobar! is not callable in %s on 
line %d
bool(false)

Warning: readline_callback_handler_install() expects exactly 2 parameters, 1 
given in %s on line %d
NULL

http://cvs.php.net/viewvc.cgi/php-src/ext/readline/tests/readline_callback_handler_remove_001.phpt?view=markup&rev=1.1
Index: php-src/ext/readline/tests/readline_callback_handler_remove_001.phpt
+++ php-src/ext/readline/tests/readline_callback_handler_remove_001.phpt
--TEST--
readline_callback_handler_remove(): Basic test
--FILE--
<?php

var_dump(readline_callback_handler_remove());
var_dump(readline_callback_handler_install('testing: ', 'foo'));

function foo() { }
var_dump(readline_callback_handler_install('testing: ', 'foo'));
var_dump(readline_callback_handler_remove());

?>
--EXPECT--
bool(false)
testing: bool(true)
testing: bool(true)
bool(true)

http://cvs.php.net/viewvc.cgi/php-src/ext/readline/tests/readline_read_history_001.phpt?view=markup&rev=1.1
Index: php-src/ext/readline/tests/readline_read_history_001.phpt
+++ php-src/ext/readline/tests/readline_read_history_001.phpt
--TEST--
readline_read_history(): Basic test
--FILE--
<?php

$name = tempnam('/tmp', 'readline.tmp');

readline_add_history("foo\n");

var_dump(readline_write_history($name));

var_dump(readline_clear_history());

var_dump(readline_read_history($name));

var_dump(readline_list_history());

unlink($name);

?>
--EXPECT--
bool(true)
bool(true)
bool(true)
array(1) {
  [0]=>
  string(3) "foo"
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to