ext-uv/tests/800-uv_tty.phpt

26 lines
490 B
Plaintext
Raw Normal View History

2012-07-07 15:28:47 +02:00
--TEST--
Check for uv_tty
2016-11-01 18:26:28 +01:00
--SKIPIF--
<?php
if (function_exists("posix_isatty") && defined("STDIN") && !posix_isatty(STDIN)) {
die("skip test requiring a tty\n");
}
?>
2012-07-07 15:28:47 +02:00
--FILE--
<?php
2015-01-18 02:58:40 +01:00
uv_fs_open(uv_default_loop(), "/dev/tty", UV::O_RDONLY, 0, function($r) {
2012-07-07 15:28:47 +02:00
$tty = uv_tty_init(uv_default_loop(), $r, 1);
uv_tty_get_winsize($tty, $width, $height);
if ($width >= 0) {
echo "OK\n";
}
if ($height >= 0) {
echo "OK\n";
}
});
uv_run();
--EXPECT--
OK
2015-01-18 02:58:40 +01:00
OK