diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2007-08-17 00:06:40 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2007-08-17 00:06:40 -0500 |
commit | eb7b05d914faa8d81a064c54bc910e4ff8616b83 (patch) | |
tree | 1721b846b539fad51890665d3e614547dcd094a5 /t/003-subprocess.t | |
parent | ffef15f0c4c80de0101c1d05b921011a37a080b8 (diff) | |
download | io-pty-easy-eb7b05d914faa8d81a064c54bc910e4ff8616b83.tar.gz io-pty-easy-eb7b05d914faa8d81a064c54bc910e4ff8616b83.zip |
we have tests
Diffstat (limited to 't/003-subprocess.t')
-rw-r--r-- | t/003-subprocess.t | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/003-subprocess.t b/t/003-subprocess.t new file mode 100644 index 0000000..edc9b09 --- /dev/null +++ b/t/003-subprocess.t @@ -0,0 +1,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"); |