summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/004-undefined-program.t7
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");