summaryrefslogtreecommitdiffstats
path: root/t/003-subprocess.t
blob: edc9b09f6fc247213f32a13a2a78c151f33b41ea (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");