summaryrefslogtreecommitdiffstats
path: root/t/undefined-program.t
blob: f53d065fe22a82d4bfe6ba2f22d301e248a40f71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;