A backend for building test libraries under Perl. Note that Test::Builder is in the early stages of development and that things may become more (or less) stable, or may change completely. Test::Builder is more flexible than other testing modules such as Test::Simple and Test::More.
Test::Builder implements the following methods.
Returns a Test::Builder object representing the current state of the test. There's no need to create more than one Test::Builder object, since you run only one test per program.
Terminates all tests and exits immediately.
Gets and sets the tests that will run and prints out the correct headers.
Specifies the package you exported your functions to.
is_eq(got_from_test, expected_from_test, name_of_test)
Checks if got_from_testeq expected_from_test.
isnt_eq(got_from_test, did_not_expect, name_of_test)
Checks if got_from_testne did_not_expect.
isnt_num(got_from_test, did_not_expect, name_of_test)
Checks if got_from_test!= did_not_expect.
is_num(got_from_test, expected_from_test, name_of_test)
Checks if got_from_test== expected_from_test.
like(string, '/regex/', name_of_test)
Checks if string matches the specified regular expression.
Declares that there may be an infinite number of tests.
Reports if test by name is true.
Sets up the tests for you, prints appropriate headers, and takes appropriate actions. plan can be used in lieu of any of the subsequent methods.
Skips the current test, citing reason.
Shamelessly skips all the tests, citing the given reason . Exits with 0.
my $reason = "I didn't feel like it today."; $Test->skip_all($reason);
unlike(string, '/regex/', name_of_test)
Checks if string does not match the specified regular expression.
Copyright © 2002 O'Reilly & Associates. All rights reserved.