IPC-Open3-Callback
view release on metacpan or search on metacpan
t/Callback.t view on Meta::CPAN
);
is( scalar(@lines), 3, 'buffer_output number of calls' );
is_deeply( \@lines, [ 'three', 'line', 'file' ], 'buffer_output match' );
$temp_file = File::Temp->new();
open( $file_handle, '>', $temp_file );
$runner = IPC::Open3::Callback->new();
$command = ( ( $^O =~ /MSWin32/ ) ? 'type ' : 'cat ' ) . $three_line_file_path;
$runner->run_command( $command, { out_handle => $file_handle } );
close($file_handle);
is( do { local ( @ARGV, $/ ) = $temp_file; <> },
do { local ( @ARGV, $/ ) = $three_line_file_path; <> },
'piped out handle'
);
open( my $three_line_file, '<', $three_line_file_path );
if ( $^O =~ /MSWin32/ ) {
$command = 'more';
$expected = "three\r\nline\r\nfile\r\n";
}
else {
$command = 'cat';
( run in 0.993 second using v1.01-cache-2.11-cpan-49f99fa48dc )