{
    "mode": "perldoc",
    "parameter": "TAP::Parser::Result",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3AResult/json",
    "generated": "2026-07-05T10:02:57Z",
    "synopsis": "# abstract class - not meant to be used directly\n# see TAP::Parser::ResultFactory for preferred usage\n# directly:\nuse TAP::Parser::Result;\nmy $token  = {...};\nmy $result = TAP::Parser::Result->new( $token );\nDESCRIPTION\nThis is a simple base class used by TAP::Parser to store objects that represent the current bit\nof test output data from TAP (usually a single line). Unless you're subclassing, you probably\nwon't need to use this module directly.\nMETHODS\n\"new\"\n# see TAP::Parser::ResultFactory for preferred usage\n# to use directly:\nmy $result = TAP::Parser::Result->new($token);\nReturns an instance the appropriate class for the test token passed in.",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::Result - Base class for TAP::Parser output objects\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.43\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "# abstract class - not meant to be used directly\n# see TAP::Parser::ResultFactory for preferred usage\n\n# directly:\nuse TAP::Parser::Result;\nmy $token  = {...};\nmy $result = TAP::Parser::Result->new( $token );\n\nDESCRIPTION\nThis is a simple base class used by TAP::Parser to store objects that represent the current bit\nof test output data from TAP (usually a single line). Unless you're subclassing, you probably\nwon't need to use this module directly.\n\nMETHODS\n\"new\"\n# see TAP::Parser::ResultFactory for preferred usage\n\n# to use directly:\nmy $result = TAP::Parser::Result->new($token);\n\nReturns an instance the appropriate class for the test token passed in.\n",
            "subsections": [
                {
                    "name": "Boolean methods",
                    "content": "The following methods all return a boolean value and are to be overridden in the appropriate\nsubclass.\n\n*   \"isplan\"\n\nIndicates whether or not this is the test plan line.\n\n1..3\n\n*   \"ispragma\"\n\nIndicates whether or not this is a pragma line.\n\npragma +strict\n\n*   \"istest\"\n\nIndicates whether or not this is a test line.\n\nok 1 Is OK!\n\n*   \"iscomment\"\n\nIndicates whether or not this is a comment.\n\n# this is a comment\n\n*   \"isbailout\"\n\nIndicates whether or not this is bailout line.\n\nBail out! We're out of dilithium crystals.\n\n*   \"isversion\"\n\nIndicates whether or not this is a TAP version line.\n\nTAP version 4\n\n*   \"isunknown\"\n\nIndicates whether or not the current line could be parsed.\n\n... this line is junk ...\n\n*   \"isyaml\"\n\nIndicates whether or not this is a YAML chunk.\n\n\"raw\"\nprint $result->raw;\n\nReturns the original line of text which was parsed.\n\n\"type\"\nmy $type = $result->type;\n\nReturns the \"type\" of a token, such as \"comment\" or \"test\".\n\n\"asstring\"\nprint $result->asstring;\n\nPrints a string representation of the token. This might not be the exact output, however. Tests\nwill have test numbers added if not present, TODO and SKIP directives will be capitalized and,\nin general, things will be cleaned up. If you need the original text for the token, see the\n\"raw\" method.\n\n\"isok\"\nif ( $result->isok ) { ... }\n\nReports whether or not a given result has passed. Anything which is not a test result returns\ntrue. This is merely provided as a convenient shortcut.\n\n\"passed\"\nDeprecated. Please use \"isok\" instead.\n\n\"hasdirective\"\nif ( $result->hasdirective ) {\n...\n}\n\nIndicates whether or not the given result has a TODO or SKIP directive.\n\n\"hastodo\"\nif ( $result->hastodo ) {\n...\n}\n\nIndicates whether or not the given result has a TODO directive.\n\n\"hasskip\"\nif ( $result->hasskip ) {\n...\n}\n\nIndicates whether or not the given result has a SKIP directive.\n\n\"setdirective\"\nSet the directive associated with this token. Used internally to fake TODO tests.\n"
                }
            ]
        },
        "SUBCLASSING": {
            "content": "Please see \"SUBCLASSING\" in TAP::Parser for a subclassing overview.\n\nRemember: if you want your subclass to be automatically used by the parser, you'll have to\nregister it with \"registertype\" in TAP::Parser::ResultFactory.\n\nIf you're creating a completely new result *type*, you'll probably need to subclass\nTAP::Parser::Grammar too, or else it'll never get used.\n",
            "subsections": [
                {
                    "name": "Example",
                    "content": "package MyResult;\n\nuse strict;\n\nuse base 'TAP::Parser::Result';\n\n# register with the factory:\nTAP::Parser::ResultFactory->registertype( 'mytype' => PACKAGE );\n\nsub asstring { 'My results all look the same' }\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "TAP::Object, TAP::Parser, TAP::Parser::ResultFactory, TAP::Parser::Result::Bailout,\nTAP::Parser::Result::Comment, TAP::Parser::Result::Plan, TAP::Parser::Result::Pragma,\nTAP::Parser::Result::Test, TAP::Parser::Result::Unknown, TAP::Parser::Result::Version,\nTAP::Parser::Result::YAML,\n",
            "subsections": []
        }
    },
    "summary": "TAP::Parser::Result - Base class for TAP::Parser output objects",
    "flags": [],
    "examples": [],
    "see_also": []
}