TAP::Parser::Result - TAP::Parser output
my $result = TAP::Parser::Result->new($token);
Returns an instance the appropriate class for the test token passed in.
1..3
pragma +strict
ok 1 Is OK!
# this is a comment
Bail out! We're out of dilithium crystals.
TAP version 4
... this line is junk ...
print $result->raw;
Returns the original line of text which was parsed.
my $type = $result->type;
Returns the ``type'' of a token, such as "comment" or "test".
print $result->as_string;
Prints a string representation of the token. This might not be the exact output, however. Tests will have test numbers added if not present, TODO and SKIP directives will be capitalized and, in general, things will be cleaned up. If you need the original text for the token, see the "raw" method.
if ( $result->is_ok ) { ... }
Reports whether or not a given result has passed. Anything which is not a test result returns true. This is merely provided as a convenient shortcut.
Deprecated. Please use "is_ok" instead.
if ( $result->has_directive ) { ... }
Indicates whether or not the given result has a TODO or SKIP directive.
if ( $result->has_todo ) { ... }
Indicates whether or not the given result has a TODO directive.
if ( $result->has_skip ) { ... }
Indicates whether or not the given result has a SKIP directive.
Set the directive associated with this token. Used internally to fake TODO tests.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |