TB2::Result::Base - Store the result of an assert
# Use TB2::Result as a factory, not TB2::Result::Base directly my $result = TB2::Result->new_result(%options);
This represents the result of an assert, whether it passed or failed, if it had any modifiers (directives), additional diagnostic information, etc...
NOTE: This object is in a very high state of flux.
A Result object used as a boolean will be true if the assert passed, false otherwise.
It has all the attributes and methods of a normal TB2::Event plus...
my $name = $result->name;
The name of the assert. For example...
# The name is "addition" ok( 1 + 1, "addition" );
my $diag = $result->diag;
The structured diagnostics associated with this result.
Diagnostics are currently an array ref of key/value pairs. Its an array ref to keep the order. This will probably change.
my $reason = $result->reason;
The reason for any modifiers.
my $number = $result->test_number;
The number associated with this test, if any.
NOTE that most testing systems don't number their results. And even TAP tests are not required to do so.
my $type = $result->build_event_type;
Returns the type of this Event, for differenciation between other Event objects.
The type is "result".
Returns true if the assert passed without regard to any modifiers.
Returns true if the result is unknown. This usually indicates that there should be a test here but none was written or it was skipped.
An example is a test skipped because it is not relevant to the current environment (like a Windows specific test on a Unix machine).
Returns true if this test is considered a pass after consideration of any modifiers.
For example, the result of a TODO test is always considered a pass no matter what the actual result of the assert is.
The opposite of is_pass.
Returns true if this result is TODO.
Returns true if the assert was recording as existing but never run.
TB2::Result Factory for creating results
TB2::History Store the results
TB2::Formatter Format results for display
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.