diff options
author | doy <doy@tozt.net> | 2009-02-03 20:17:50 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-02-03 20:17:50 -0500 |
commit | db35dd17e7c9268ca5300b3a475cf93f1f70f04c (patch) | |
tree | 238cd8d7c9cd03d48022fd5df375122c83e7fa69 /t/004-undefined-program.t | |
parent | 6b0de765461e3592e0fd2a88051eeadaac516158 (diff) | |
download | io-pty-easy-db35dd17e7c9268ca5300b3a475cf93f1f70f04c.tar.gz io-pty-easy-db35dd17e7c9268ca5300b3a475cf93f1f70f04c.zip |
make test 004 timeout rather than hanging on systems where it's broken
Diffstat (limited to 't/004-undefined-program.t')
-rw-r--r-- | t/004-undefined-program.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/004-undefined-program.t b/t/004-undefined-program.t index 8ecf475..5b398c6 100644 --- a/t/004-undefined-program.t +++ b/t/004-undefined-program.t @@ -5,6 +5,11 @@ use Test::More tests => 2; use IO::Pty::Easy; my $pty = new IO::Pty::Easy; -eval { $pty->spawn("missing_program_io_pty_easy") }; +eval { + local $SIG{ALRM} = sub { die "alarm\n" }; + alarm 5; + $pty->spawn("missing_program_io_pty_easy"); + alarm 0; +}; like($@, qr/Cannot exec\(missing_program_io_pty_easy\)/); ok(!$pty->is_active, "pty isn't active if program doesn't exist"); |