Test::Output

Utilities to test STDOUT and STDERR messages
Download

Test::Output Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • brian d foy
  • Publisher web site:
  • http://search.cpan.org/~bdfoy/

Test::Output Tags


Test::Output Description

Test::Output is a Perl module that provides a simple interface for testing output sent to STDOUT or STDERR. A number of different utilities are included to try and be as flexible as possible to the tester.Originally this module was designed not to have external requirements, however, the features provided by Sub::Exporter over what Exporter provides is just to great to pass up.Test::Output ties STDOUT and STDERR using Test::Output::Tie.SYNOPSIS use Test::More tests => 4; use Test::Output; sub writer { print "Write out.\n"; print STDERR "Error out.\n"; } stdout_is(\&writer,"Write out.\n",'Test STDOUT'); stderr_isnt(\&writer,"No error out.\n",'Test STDERR'); combined_is( \&writer, "Write out.\nError out.\n", 'Test STDOUT & STDERR combined' ); output_is( \&writer, "Write out.\n", "Error out.\n", 'Test STDOUT & STDERR' ); # Use bare blocks. stdout_is { print "test" } "test", "Test STDOUT"; stderr_isnt { print "bad test" } "test", "Test STDERR"; output_is { print 'STDOUT'; print STDERR 'STDERR' } "STDOUT", "STDERR", "Test output";Product's homepage


Test::Output Related Software