TAP::Parser::Result::Test - Test result token.
Version 3.52
This is a subclass of TAP::Parser::Result. A token of this class will be returned if a test line is encountered.
1..1
ok 1 - woo hooo!
This class is the workhorse of the TAP::Parser system. Most TAP lines will be test lines and if $result->is_test, then you have a bunch of methods at your disposal.
okmy $ok = $result->ok;
Returns the literal text of the ok or not ok status.
numbermy $test_number = $result->number;
Returns the number of the test, even if the original TAP output did not supply that number.
descriptionmy $description = $result->description;
Returns the description of the test, if any. This is the portion after the test number but before the directive.
directivemy $directive = $result->directive;
Returns either TODO or SKIP if either directive was present for a test line.
explanationmy $explanation = $result->explanation;
If a test had either a TODO or SKIP directive, this method will return the accompanying explanation, if present.
not ok 17 - 'Pigs can fly' # TODO not enough acid
For the above line, the explanation is not enough acid.
is_okif ( $result->is_ok ) { ... }
Returns a boolean value indicating whether or not the test passed. Remember that for TODO tests, the test always passes.
If the test is unplanned, this method will always return false. See is_unplanned.
is_actual_okif ( $result->is_actual_ok ) { ... }
Returns a boolean value indicating whether or not the test passed, regardless of its TODO status.
actual_passedDeprecated. Please use is_actual_ok instead.
todo_passedif ( $test->todo_passed ) {
# test unexpectedly succeeded
}
If this is a TODO test and an 'ok' line, this method returns true. Otherwise, it will always return false (regardless of passing status on non-todo tests).
This is used to track which tests unexpectedly succeeded.
todo_failed# deprecated in favor of 'todo_passed'. This method was horribly misnamed.
This was a badly misnamed method. It indicates which TODO tests unexpectedly succeeded. Will now issue a warning and call todo_passed.
has_skipif ( $result->has_skip ) { ... }
Returns a boolean value indicating whether or not this test has a SKIP directive.
has_todoif ( $result->has_todo ) { ... }
Returns a boolean value indicating whether or not this test has a TODO directive.