Test-Tester

Test::Tester(3p) Perl Programmers Reference Guide Test::Tester(3p)

Test-Tester

Test::Tester(3p) Perl Programmers Reference Guide Test::Tester(3p) # Test::Tester(3p) Perl Programmers Reference Guide Test::Tester(3p) NNAAMMEE # Test::Tester - Ease testing test modules built with Test::Builder SSYYNNOOPPSSIISS # use Test::Tester tests => 6; use Test::MyStyle; check_test( sub { is_mystyle_eq("this", "that", "not eq"); }, { ok => 0, # expect this to fail name => "not eq", diag => "Expected: 'this'\nGot: 'that'", } ); or use Test::Tester tests => 6; use Test::MyStyle; check_test( sub { is_mystyle_qr("this", "that", "not matching"); }, { ok => 0, # expect this to fail name => "not matching", diag => qr/Expected: 'this'\s+Got: 'that'/, } ); or use Test::Tester; use Test::More tests => 3; use Test::MyStyle; my ($premature, @results) = run_tests( sub { is_database_alive("dbname"); } ); # now use Test::More::like to check the diagnostic output like($results[0]->{diag}, "/^Database ping took \\d+ seconds$"/, "diag"); DDEESSCCRRIIPPTTIIOONN # If you have written a test module based on Test::Builder then Test::Tester allows you to test it with the minimum of effort. ...