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

my $pty = new IO::Pty::Easy;
my $script = "$^X -e '-t *STDIN && -t *STDOUT && print \"ok\";'";

my $outside_of_pty = `$script`;
unlike($outside_of_pty, qr/ok/, "running outside of pty fails -t checks");

$pty->spawn("$script");
like($pty->read, qr/ok/, "runs subprocess in a pty");