{
    "mode": "perldoc",
    "parameter": "TAP::Parser::Result::Test",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/TAP%3A%3AParser%3A%3AResult%3A%3ATest/json",
    "generated": "2026-10-04T07:53:28Z",
    "sections": {
        "NAME": {
            "content": "TAP::Parser::Result::Test - Test result token.\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version 3.44\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a subclass of TAP::Parser::Result. A token of this class will be returned if a test line\nis encountered.\n\n1..1\nok 1 - woo hooo!\n",
            "subsections": []
        },
        "OVERRIDDEN METHODS": {
            "content": "This class is the workhorse of the TAP::Parser system. Most TAP lines will be test lines and if\n\"$result->istest\", then you have a bunch of methods at your disposal.\n",
            "subsections": [
                {
                    "name": "Instance Methods",
                    "content": "\"ok\"\nmy $ok = $result->ok;\n\nReturns the literal text of the \"ok\" or \"not ok\" status.\n\n\"number\"\nmy $testnumber = $result->number;\n\nReturns the number of the test, even if the original TAP output did not supply that number.\n\n\"description\"\nmy $description = $result->description;\n\nReturns the description of the test, if any. This is the portion after the test number but\nbefore the directive.\n\n\"directive\"\nmy $directive = $result->directive;\n\nReturns either \"TODO\" or \"SKIP\" if either directive was present for a test line.\n\n\"explanation\"\nmy $explanation = $result->explanation;\n\nIf a test had either a \"TODO\" or \"SKIP\" directive, this method will return the accompanying\nexplanation, if present.\n\nnot ok 17 - 'Pigs can fly' # TODO not enough acid\n\nFor the above line, the explanation is *not enough acid*.\n\n\"isok\"\nif ( $result->isok ) { ... }\n\nReturns a boolean value indicating whether or not the test passed. Remember that for TODO tests,\nthe test always passes.\n\nIf the test is unplanned, this method will always return false. See \"isunplanned\".\n\n\"isactualok\"\nif ( $result->isactualok ) { ... }\n\nReturns a boolean value indicating whether or not the test passed, regardless of its TODO\nstatus.\n\n\"actualpassed\"\nDeprecated. Please use \"isactualok\" instead.\n\n\"todopassed\"\nif ( $test->todopassed ) {\n# test unexpectedly succeeded\n}\n\nIf this is a TODO test and an 'ok' line, this method returns true. Otherwise, it will always\nreturn false (regardless of passing status on non-todo tests).\n\nThis is used to track which tests unexpectedly succeeded.\n\n\"todofailed\"\n# deprecated in favor of 'todopassed'.  This method was horribly misnamed.\n\nThis was a badly misnamed method. It indicates which TODO tests unexpectedly succeeded. Will now\nissue a warning and call \"todopassed\".\n\n\"hasskip\"\nif ( $result->hasskip ) { ... }\n\nReturns a boolean value indicating whether or not this test has a SKIP directive.\n\n\"hastodo\"\nif ( $result->hastodo ) { ... }\n\nReturns a boolean value indicating whether or not this test has a TODO directive.\n\n\"asstring\"\nprint $result->asstring;\n\nThis method prints the test as a string. It will probably be similar, but not necessarily\nidentical, to the original test line. Directives are capitalized, some whitespace may be trimmed\nand a test number will be added if it was not present in the original line. If you need the\noriginal text of the test line, use the \"raw\" method.\n\n\"isunplanned\"\nif ( $test->isunplanned ) { ... }\n$test->isunplanned(1);\n\nIf a test number is greater than the number of planned tests, this method will return true.\nUnplanned tests will *always* return false for \"isok\", regardless of whether or not the test\n\"hastodo\".\n\nNote that if tests have a trailing plan, it is not possible to set this property for unplanned\ntests as we do not know it's unplanned until the plan is reached:\n\nprint <<'END';\nok 1\nok 2\n1..1\nEND\n"
                }
            ]
        }
    },
    "summary": "TAP::Parser::Result::Test - Test result token.",
    "flags": [],
    "examples": [],
    "see_also": []
}