summaryrefslogtreecommitdiffstats
path: root/t/004-undefined-program.t
blob: 5b398c67d12fe268ab519f48035a9b683a8f9a45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!perl
use strict;
use warnings;
use Test::More tests => 2;
use IO::Pty::Easy;

my $pty = new 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");