Test::Builder::Tester
use Test::Builder; use Test::Builder::Tester; plan 2; my $Test = Test::Builder.new(); test_out( 'ok 1 - Hello' ); $Test.ok( 1, 'Hello' ); test_test( 'passing_test ); test_out( 'not ok 2 - Goodbye' ); test_diag( "The test failed!" ); $Test.ok( 0, 'Goodbye' ) || $Test.diag( 'The test failed!' ); test_test( 'failing test with diagnostics' );
This test module allows you to test test modules that use Test::Builder. It does this by you setting the expected output and diagnostic output of tests, running those tests, and then telling this module to compare the received output to the expected output.
Plans the number of tests to run. Someday there will be a no_plan version of this too. For now, this is what you have.
no_plan
Marks that the next test should pass. $description is the optional description of the test. This is the easiest way to match a passing test.
$description
Marks that the next test should fail. $description is the optional description of the test. This is the easiest way to match a failing test.
Adds a line to the list of lines of expected output for the test you're going to run.
Adds a line to the list of lines of expected diagnostics for the test you're going to run.
Compares the receivied and expected lines from the previously run tests, passing if both the diagnostics and output match exactly. If you pass $description, this will use it as the test description.
based on Test::Tester by Mark Fowler
ported to Perl 6 by chromatic chromatic at wgz dot org
chromatic at wgz dot org
To install Perl6::Pugs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl6::Pugs
CPAN shell
perl -MCPAN -e shell install Perl6::Pugs
For more information on module installation, please visit the detailed CPAN module installation guide.