summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-02-04 23:02:30 -0500
committerdoy <doy@tozt.net>2009-02-04 23:02:30 -0500
commitca117293a75de1d36189ed9af1450da4d8de993c (patch)
tree38e05c5520c096c8953922dc9cf182d9abbfff72
parent9167bac93742e0816467f3e06f7222d40707a545 (diff)
downloadio-pty-easy-ca117293a75de1d36189ed9af1450da4d8de993c.tar.gz
io-pty-easy-ca117293a75de1d36189ed9af1450da4d8de993c.zip
add a test for read returning undef on timeout
-rw-r--r--t/010-read-write.t3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/010-read-write.t b/t/010-read-write.t
index fca876d..7cd0ada 100644
--- a/t/010-read-write.t
+++ b/t/010-read-write.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 2;
use IO::Pty::Easy;
my $pty = IO::Pty::Easy->new;
@@ -9,6 +9,7 @@ my $pty = IO::Pty::Easy->new;
$pty->spawn("$^X -ple ''");
$pty->write("testing\n");
like($pty->read, qr/testing/, "basic read/write testing");
+is($pty->read(0.1), undef, "read returns undef on timeout");
# if the perl script ends with a subprocess still running, the test will exit
# with the exit status of the signal that the subprocess dies with, so we have
# to kill the subprocess before exiting.