Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions t/pty.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ BEGIN {
use Test::More;

BEGIN {
if ( eval { require IO::Pty; } ) {
plan tests => 37;
if ( !eval { require IO::Pty; } ) {
plan skip_all => "IO::Pty not installed";
}
elsif ( !eval { IO::Pty->VERSION('1.25'); 1 } ) {
plan skip_all => "IO::Pty >= 1.25 required (have $IO::Pty::VERSION)";
}
else {
plan skip_all => "IO::Pty not installed";
plan tests => 37;
}
}

Expand All @@ -55,27 +58,6 @@ use IPC::Run qw( start pump finish );
select STDERR;
select STDOUT;

sub pty_warn {
warn "\nWARNING: $_[0].\nWARNING: '<pty<', '>pty>' $_[1] not work.\n\n";
}

if ( $^O !~ /Win32/ ) {

# my $min = 0.9;
for ( eval { require IO::Pty; IO::Pty->VERSION } ) {
s/_//g if defined;
if ( !defined ) {
pty_warn "IO::Pty not found", "will";
}
elsif ( $_ == 0.02 ) {
pty_warn "IO::Pty v$_ has spurious warnings, try 0.9 or later", "may";
}
elsif ( $_ < 1.00 ) {
pty_warn "IO::Pty 1.00 is strongly recommended", "may";
}
}
}

diag("IO::Tty $IO::Tty::VERSION, IO::Pty $IO::Pty::VERSION");

my $echoer_script = <<TOHERE;
Expand Down
9 changes: 6 additions & 3 deletions t/pty_error_handling.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ BEGIN {
use Test::More;

BEGIN {
if ( eval { require IO::Pty; } ) {
plan tests => 3;
if ( !eval { require IO::Pty; } ) {
plan skip_all => "IO::Pty not installed";
}
elsif ( !eval { IO::Pty->VERSION('1.25'); 1 } ) {
plan skip_all => "IO::Pty >= 1.25 required (have $IO::Pty::VERSION)";
}
else {
plan skip_all => "IO::Pty not installed";
plan tests => 3;
}
}

Expand Down
Loading