Devel-ebug

 view release on metacpan or  search on metacpan

t/dont_relay_io.t  view on Meta::CPAN

  open STDERR, '>&', $stderr or die "restore STDERR: $!";
}
$ebug->step for 1 .. 4;

my($stdout, $stderr) = $ebug->output;
is($stdout, '', 'nothing is captured from STDOUT');
is($stderr, '', 'nothing is captured from STDERR');

# a file is block buffered, so have the program write out what it has
$ebug->eval('require IO::Handle; STDOUT->flush');
my $written = do { local(@ARGV, $/) = $file; <> };
like($written, qr/(?:\A|\n)Hi!\n/, 'STDOUT goes where it was going');
like($written, qr/\$x is -4 at corpus\/carp\.pl line 8/, 'and so does STDERR');

# the plugin used to open a bareword NULL handle here for no reason
is($ebug->eval(q{
  my $io = *Devel::ebug::Backend::Plugin::Output::NULL{IO};
  $io && tell($io) >= 0 ? 'open' : 'none';
}), 'none', 'no stray NULL filehandle is left open');



( run in 1.164 second using v1.01-cache-2.11-cpan-ac8be02dad9 )