summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-03-07 03:02:04 -0600
committerJesse Luehrs <doy@tozt.net>2012-03-07 03:02:04 -0600
commit5eab8070cba0f8feba78bddcd68bc6028a0a00e3 (patch)
tree1dedda8a47d8eba238fb9bd9514ae55d975cddd3
parent8102ebfac9c81a7040ff5ab137f366624a223387 (diff)
downloadapp-ttyrec-5eab8070cba0f8feba78bddcd68bc6028a0a00e3.tar.gz
app-ttyrec-5eab8070cba0f8feba78bddcd68bc6028a0a00e3.zip
make this test a bit more reliable
-rw-r--r--t/basic.t9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/basic.t b/t/basic.t
index 977ccc5..abad5c2 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -68,14 +68,17 @@ fail if length($current_frame_data);
fail if $current_frame_idx != 3;
sub full_read {
- my ($pty) = @_;
+ my ($fh) = @_;
- my $select = IO::Select->new($pty);
+ my $select = IO::Select->new($fh);
return if $select->has_exception(0.1);
+ 1 while !$select->can_read(1);
+
my $ret;
while ($select->can_read(1)) {
- my $new = $pty->read;
+ my $new;
+ sysread($fh, $new, 4096);
last unless defined($new) && length($new);
$ret .= $new;
return $ret if $select->has_exception(0.1);