9/4/2023 0 Comments Perl Builder![]() ![]() Result in this structure: $tests = # 23 - 1, since arrays start from 0. They are considered ok, but the name and actual_ok is left undef.įor example "not ok 23 - hole count # TODO insufficient donuts" would These details for these tests are filled in. In these cases, Test::Builder doesn't know the result of the test, so Printing any test output, for example, when current_test() is changed. Sometimes the Test::Builder test counter is incremented without it Type can be one of the following: skip see skip() 'type' indicates if it was a special test. This is for examining the result of 'todo' 'actual_ok' is a reflection of whether or not the test literally 'ok' is true if Test::Harness will consider the test to be a pass. Its also valuable if the builder is pretty long I never put a default more than a line long into an attribute definition. Using builder allows late-binding, which plays nicely with roles and classes that are intended to be subclassed. Type => type of test (if any, see below). I think youve already answered your own question. Like summary(), but with a lot more detail. This is a logical pass/fail, so todos are passes. If set backward, the details of the intervening tests are deleted. If set forward, the details of the missing tests are filled in as 'unknown'. Gets/sets the current test number we're on. current_test my $curr_test = $Test ->current_test $Test ->current_test ( $num ).Where diagnostics about todo test failures and diag() should go. $Test ->todo_output ( $fh ) $Test ->todo_output ( $file ) Where diagnostic output on test failures and diag() should go.ĭefaults to STDERR. $Test ->failure_output ( $fh ) $Test ->failure_output ( $file ) Where normal "ok/not ok" test output should go.ĭefaults to STDOUT. $Test ->output ( $fh ) $Test ->output ( $file ) Like _print, but prints to the current diagnostic filehandle. Why? Because diag() is often used in conjunction with ![]() We encourage using this rather than calling print directly. A newline will be put on the end if there isn't one Output will be indented and marked with a # so as not to interfere TODO test, the todo_output() handle is used. Normally, it uses the failure_output() handle, but if this is for a Prints out the given Like print, arguments are simply Test::Builder's default output settings will not be affected. It's ok for your test to change where STDOUT and STDERR point to, If this is true, none of that will be done. It also changes the exit code as described below. Normally, Test::Builder does some extra diagnostics when the testĮnds. perl-builder is a program that allows you to create installers for specific versions of Perl. no_ending $Test ->no_ending ( $no_ending ).If set to true, no "1.N" header will be printed. no_header $Test ->no_header ( $no_header ).Test::Harness will accept either, but avoid mixing the two styles. Most useful when you can't depend on the test output order, such as Whether or not the test should output numbers. use_numbers $Test ->use_numbers ( $on_or_off ).Test::Builder - Backend for building test libraries SYNOPSIS package My::Test::Module use Test::Builder require Exporter = qw(Exporter) = qw(ok) my $Test = Test::Builder->new $Test ->output ( 'my_logfile' ) sub import ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |