diff options
Diffstat (limited to 't/spawn.t')
-rw-r--r-- | t/spawn.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/spawn.t b/t/spawn.t new file mode 100644 index 0000000..9bdc498 --- /dev/null +++ b/t/spawn.t @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use IO::Pty::Easy; + +my $pty = IO::Pty::Easy->new; +$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(!$pty->opened, "closing a pty after a spawn"); + +done_testing; |