summaryrefslogtreecommitdiffstats
path: root/t/undefined-program.t
diff options
context:
space:
mode:
Diffstat (limited to 't/undefined-program.t')
-rw-r--r--t/undefined-program.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/undefined-program.t b/t/undefined-program.t
new file mode 100644
index 0000000..f53d065
--- /dev/null
+++ b/t/undefined-program.t
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use IO::Pty::Easy;
+
+my $pty = IO::Pty::Easy->new;
+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");
+
+done_testing;