Test::Out

Test output from FILEHANDLE
Download

Test::Out Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Lane Davis
  • Publisher web site:
  • http://search.cpan.org/~ldavis/

Test::Out Tags


Test::Out Description

Test output from FILEHANDLE Test::Out is another Test::Builder application that implements a few of the well known test facilities except the result of output to an IO::Handle is used. This could be used to capture output being printed to a file, but it's ideal for output being sent to STDOUT or STDERR.SYNOPSIS use Test::Out; my $out = Test::Out->new( output => *STDOUT, tests => 4 ); # Or ... my $out = Test::Out->new(tests => 4); $out->redirect( output => *STDOUT ); ## This will go to a place that your harness can see $out->diag("Testing is* functions"); ## But this will not be displayed but captured for test methods $some->method_that_prints("This is a test\n"); $out->is_output("This is a test\n", "test 1"); $out->isnt_output("Han shot first", "test 2"); $out->diag("Testing regex functions"); CORE::print "A random number: @{}\n"; $out->like_output(qr/random number: \d+/, "test 3"); $out->unlike_output(qr/i like pickles$/, "test 4"); $out->restore; ## This will be printed to STDOUT print "Done.\n"; Requirements: · Perl


Test::Out Related Software