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

my $pty = new IO::Pty::Easy;
$pty->spawn("$^X -ple ''");
ok($pty->is_active, "spawning a subprocess");
ok($pty->kill(0, 1), "subprocess actually exists");
$pty->kill;
ok(!$pty->is_active, "killing a subprocess");
$pty->spawn("$^X -ple ''");
$pty->close;
ok(!$pty->is_active, "auto-killing a pty with close()");
ok(!defined($pty->{pty}), "closing a pty after a spawn");