{
    "content": [
        {
            "type": "text",
            "text": "# Test::More (perldoc)\n\n## NAME\n\nTest::More - yet another framework for writing test scripts\n\n## SYNOPSIS\n\nuse Test::More tests => 23;\n# or\nuse Test::More skipall => $reason;\n# or\nuse Test::More;   # see donetesting()\nrequireok( 'Some::Module' );\n# Various ways to say \"ok\"\nok($got eq $expected, $testname);\nis  ($got, $expected, $testname);\nisnt($got, $expected, $testname);\n# Rather than print STDERR \"# here's what went wrong\\n\"\ndiag(\"here's what went wrong\");\nlike  ($got, qr/expected/, $testname);\nunlike($got, qr/expected/, $testname);\ncmpok($got, '==', $expected, $testname);\nisdeeply($gotcomplexstructure, $expectedcomplexstructure, $testname);\nSKIP: {\nskip $why, $howmany unless $havesomefeature;\nok( foo(),       $testname );\nis( foo(42), 23, $testname );\n};\nTODO: {\nlocal $TODO = $why;\nok( foo(),       $testname );\nis( foo(42), 23, $testname );\n};\ncanok($module, @methods);\nisaok($object, $class);\npass($testname);\nfail($testname);\nBAILOUT($why);\n# UNIMPLEMENTED!!!\nmy @status = Test::More::status;\n\n## DESCRIPTION\n\nSTOP! If you're just getting started writing tests, have a look at Test2::Suite first.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (8 subsections)\n- **EXIT CODES**\n- **COMPATIBILITY**\n- **HISTORY**\n- **SEE ALSO**\n- **AUTHORS**\n- **MAINTAINERS**\n- **BUGS**\n- **SOURCE**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Test::More",
        "section": "",
        "mode": "perldoc",
        "summary": "Test::More - yet another framework for writing test scripts",
        "synopsis": "use Test::More tests => 23;\n# or\nuse Test::More skipall => $reason;\n# or\nuse Test::More;   # see donetesting()\nrequireok( 'Some::Module' );\n# Various ways to say \"ok\"\nok($got eq $expected, $testname);\nis  ($got, $expected, $testname);\nisnt($got, $expected, $testname);\n# Rather than print STDERR \"# here's what went wrong\\n\"\ndiag(\"here's what went wrong\");\nlike  ($got, qr/expected/, $testname);\nunlike($got, qr/expected/, $testname);\ncmpok($got, '==', $expected, $testname);\nisdeeply($gotcomplexstructure, $expectedcomplexstructure, $testname);\nSKIP: {\nskip $why, $howmany unless $havesomefeature;\nok( foo(),       $testname );\nis( foo(42), 23, $testname );\n};\nTODO: {\nlocal $TODO = $why;\nok( foo(),       $testname );\nis( foo(42), 23, $testname );\n};\ncanok($module, @methods);\nisaok($object, $class);\npass($testname);\nfail($testname);\nBAILOUT($why);\n# UNIMPLEMENTED!!!\nmy @status = Test::More::status;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 49,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 77,
                "subsections": [
                    {
                        "name": "Test names",
                        "lines": 339
                    },
                    {
                        "name": "Module tests",
                        "lines": 75
                    },
                    {
                        "name": "Complex data structures",
                        "lines": 35
                    },
                    {
                        "name": "Diagnostics",
                        "lines": 55
                    },
                    {
                        "name": "Conditional tests",
                        "lines": 103
                    },
                    {
                        "name": "Test control",
                        "lines": 14
                    },
                    {
                        "name": "Discouraged comparison functions",
                        "lines": 48
                    },
                    {
                        "name": "Extending and Embedding Test::More",
                        "lines": 13
                    }
                ]
            },
            {
                "name": "EXIT CODES",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY",
                "lines": 81,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 32,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "MAINTAINERS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 7,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Test::More - yet another framework for writing test scripts\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Test::More tests => 23;\n# or\nuse Test::More skipall => $reason;\n# or\nuse Test::More;   # see donetesting()\n\nrequireok( 'Some::Module' );\n\n# Various ways to say \"ok\"\nok($got eq $expected, $testname);\n\nis  ($got, $expected, $testname);\nisnt($got, $expected, $testname);\n\n# Rather than print STDERR \"# here's what went wrong\\n\"\ndiag(\"here's what went wrong\");\n\nlike  ($got, qr/expected/, $testname);\nunlike($got, qr/expected/, $testname);\n\ncmpok($got, '==', $expected, $testname);\n\nisdeeply($gotcomplexstructure, $expectedcomplexstructure, $testname);\n\nSKIP: {\nskip $why, $howmany unless $havesomefeature;\n\nok( foo(),       $testname );\nis( foo(42), 23, $testname );\n};\n\nTODO: {\nlocal $TODO = $why;\n\nok( foo(),       $testname );\nis( foo(42), 23, $testname );\n};\n\ncanok($module, @methods);\nisaok($object, $class);\n\npass($testname);\nfail($testname);\n\nBAILOUT($why);\n\n# UNIMPLEMENTED!!!\nmy @status = Test::More::status;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "STOP! If you're just getting started writing tests, have a look at Test2::Suite first.\n\nThis is a drop in replacement for Test::Simple which you can switch to once you get the hang of\nbasic testing.\n\nThe purpose of this module is to provide a wide range of testing utilities. Various ways to say\n\"ok\" with better diagnostics, facilities to skip tests, test future features and compare\ncomplicated data structures. While you can do almost anything with a simple \"ok()\" function, it\ndoesn't provide good diagnostic output.\n\nI love it when a plan comes together\nBefore anything else, you need a testing plan. This basically declares how many tests your\nscript is going to run to protect against premature failure.\n\nThe preferred way to do this is to declare a plan when you \"use Test::More\".\n\nuse Test::More tests => 23;\n\nThere are cases when you will not know beforehand how many tests your script is going to run. In\nthis case, you can declare your tests at the end.\n\nuse Test::More;\n\n... run your tests ...\n\ndonetesting( $numberoftestsrun );\n\nNOTE \"donetesting()\" should never be called in an \"END { ... }\" block.\n\nSometimes you really don't know how many tests were run, or it's too difficult to calculate. In\nwhich case you can leave off $numberoftestsrun.\n\nIn some cases, you'll want to completely skip an entire testing script.\n\nuse Test::More skipall => $skipreason;\n\nYour script will declare a skip with the reason why you skipped and exit immediately with a zero\n(success). See Test::Harness for details.\n\nIf you want to control what functions Test::More will export, you have to use the 'import'\noption. For example, to import everything but 'fail', you'd do:\n\nuse Test::More tests => 23, import => ['!fail'];\n\nAlternatively, you can use the \"plan()\" function. Useful for when you have to calculate the\nnumber of tests.\n\nuse Test::More;\nplan tests => keys %Stuff * 3;\n\nor for deciding between running the tests at all:\n\nuse Test::More;\nif( $^O eq 'MacOS' ) {\nplan skipall => 'Test irrelevant on MacOS';\n}\nelse {\nplan tests => 42;\n}\n\ndonetesting\ndonetesting();\ndonetesting($numberoftests);\n\nIf you don't know how many tests you're going to run, you can issue the plan when you're\ndone running tests.\n\n$numberoftests is the same as \"plan()\", it's the number of tests you expected to run. You\ncan omit this, in which case the number of tests you ran doesn't matter, just the fact that\nyour tests ran to conclusion.\n\nThis is safer than and replaces the \"noplan\" plan.\n\nNote: You must never put \"donetesting()\" inside an \"END { ... }\" block. The plan is there\nto ensure your test does not exit before testing has completed. If you use an END block you\ncompletely bypass this protection.\n",
                "subsections": [
                    {
                        "name": "Test names",
                        "content": "By convention, each test is assigned a number in order. This is largely done automatically for\nyou. However, it's often very useful to assign a name to each test. Which would you rather see:\n\nok 4\nnot ok 5\nok 6\n\nor\n\nok 4 - basic multi-variable\nnot ok 5 - simple exponential\nok 6 - force == mass * acceleration\n\nThe later gives you some idea of what failed. It also makes it easier to find the test in your\nscript, simply search for \"simple exponential\".\n\nAll test functions take a name argument. It's optional, but highly suggested that you use it.\n\nI'm ok, you're not ok.\nThe basic purpose of this module is to print out either \"ok #\" or \"not ok #\" depending on if a\ngiven test succeeded or failed. Everything else is just gravy.\n\nAll of the following print \"ok\" or \"not ok\" depending on if the test succeeded or failed. They\nall also return true or false, respectively.\n\nok\nok($got eq $expected, $testname);\n\nThis simply evaluates any expression (\"$got eq $expected\" is just a simple example) and uses\nthat to determine if the test succeeded or failed. A true expression passes, a false one\nfails. Very simple.\n\nFor example:\n\nok( $exp{9} == 81,                   'simple exponential' );\nok( Film->can('dbMain'),            'setdb()' );\nok( $p->tests == 4,                  'saw tests' );\nok( !grep(!defined $, @items),      'all items defined' );\n\n(Mnemonic: \"This is ok.\")\n\n$testname is a very short description of the test that will be printed out. It makes it\nvery easy to find a test in your script when it fails and gives others an idea of your\nintentions. $testname is optional, but we very strongly encourage its use.\n\nShould an \"ok()\" fail, it will produce some diagnostics:\n\nnot ok 18 - sufficient mucus\n#   Failed test 'sufficient mucus'\n#   in foo.t at line 42.\n\nThis is the same as Test::Simple's \"ok()\" routine.\n\nis\nisnt\nis  ( $got, $expected, $testname );\nisnt( $got, $expected, $testname );\n\nSimilar to \"ok()\", \"is()\" and \"isnt()\" compare their two arguments with \"eq\" and \"ne\"\nrespectively and use the result of that to determine if the test succeeded or failed. So\nthese:\n\n# Is the ultimate answer 42?\nis( ultimateanswer(), 42,          \"Meaning of Life\" );\n\n# $foo isn't empty\nisnt( $foo, '',     \"Got some foo\" );\n\nare similar to these:\n\nok( ultimateanswer() eq 42,        \"Meaning of Life\" );\nok( $foo ne '',     \"Got some foo\" );\n\n\"undef\" will only ever match \"undef\". So you can test a value against \"undef\" like this:\n\nis($notdefined, undef, \"undefined as expected\");\n\n(Mnemonic: \"This is that.\" \"This isn't that.\")\n\nSo why use these? They produce better diagnostics on failure. \"ok()\" cannot know what you\nare testing for (beyond the name), but \"is()\" and \"isnt()\" know what the test was and why it\nfailed. For example this test:\n\nmy $foo = 'waffle';  my $bar = 'yarblokos';\nis( $foo, $bar,   'Is foo the same as bar?' );\n\nWill produce something like this:\n\nnot ok 17 - Is foo the same as bar?\n#   Failed test 'Is foo the same as bar?'\n#   in foo.t at line 139.\n#          got: 'waffle'\n#     expected: 'yarblokos'\n\nSo you can figure out what went wrong without rerunning the test.\n\nYou are encouraged to use \"is()\" and \"isnt()\" over \"ok()\" where possible, however do not be\ntempted to use them to find out if something is true or false!\n\n# XXX BAD!\nis( exists $brooklyn{tree}, 1, 'A tree grows in Brooklyn' );\n\nThis does not check if \"exists $brooklyn{tree}\" is true, it checks if it returns 1. Very\ndifferent. Similar caveats exist for false and 0. In these cases, use \"ok()\".\n\nok( exists $brooklyn{tree},    'A tree grows in Brooklyn' );\n\nA simple call to \"isnt()\" usually does not provide a strong test but there are cases when\nyou cannot say much more about a value than that it is different from some other value:\n\nnewok $obj, \"Foo\";\n\nmy $clone = $obj->clone;\nisaok $obj, \"Foo\", \"Foo->clone\";\n\nisnt $obj, $clone, \"clone() produces a different object\";\n\nFor those grammatical pedants out there, there's an \"isn't()\" function which is an alias of\n\"isnt()\".\n\nlike\nlike( $got, qr/expected/, $testname );\n\nSimilar to \"ok()\", \"like()\" matches $got against the regex \"qr/expected/\".\n\nSo this:\n\nlike($got, qr/expected/, 'this is like that');\n\nis similar to:\n\nok( $got =~ m/expected/, 'this is like that');\n\n(Mnemonic \"This is like that\".)\n\nThe second argument is a regular expression. It may be given as a regex reference (i.e.\n\"qr//\") or (for better compatibility with older perls) as a string that looks like a regex\n(alternative delimiters are currently not supported):\n\nlike( $got, '/expected/', 'this is like that' );\n\nRegex options may be placed on the end ('/expected/i').\n\nIts advantages over \"ok()\" are similar to that of \"is()\" and \"isnt()\". Better diagnostics on\nfailure.\n\nunlike\nunlike( $got, qr/expected/, $testname );\n\nWorks exactly as \"like()\", only it checks if $got does not match the given pattern.\n\ncmpok\ncmpok( $got, $op, $expected, $testname );\n\nHalfway between \"ok()\" and \"is()\" lies \"cmpok()\". This allows you to compare two arguments\nusing any binary perl operator. The test passes if the comparison is true and fails\notherwise.\n\n# ok( $got eq $expected );\ncmpok( $got, 'eq', $expected, 'this eq that' );\n\n# ok( $got == $expected );\ncmpok( $got, '==', $expected, 'this == that' );\n\n# ok( $got && $expected );\ncmpok( $got, '&&', $expected, 'this && that' );\n...etc...\n\nIts advantage over \"ok()\" is when the test fails you'll know what $got and $expected were:\n\nnot ok 1\n#   Failed test in foo.t at line 12.\n#     '23'\n#         &&\n#     undef\n\nIt's also useful in those cases where you are comparing numbers and \"is()\"'s use of \"eq\"\nwill interfere:\n\ncmpok( $bighairynumber, '==', $anotherbighairynumber );\n\nIt's especially useful when comparing greater-than or smaller-than relation between values:\n\ncmpok( $somevalue, '<=', $upperlimit );\n\ncanok\ncanok($module, @methods);\ncanok($object, @methods);\n\nChecks to make sure the $module or $object can do these @methods (works with functions,\ntoo).\n\ncanok('Foo', qw(this that whatever));\n\nis almost exactly like saying:\n\nok( Foo->can('this') &&\nFoo->can('that') &&\nFoo->can('whatever')\n);\n\nonly without all the typing and with a better interface. Handy for quickly testing an\ninterface.\n\nNo matter how many @methods you check, a single \"canok()\" call counts as one test. If you\ndesire otherwise, use:\n\nforeach my $meth (@methods) {\ncanok('Foo', $meth);\n}\n\nisaok\nisaok($object,   $class, $objectname);\nisaok($subclass, $class, $objectname);\nisaok($ref,      $type,  $refname);\n\nChecks to see if the given \"$object->isa($class)\". Also checks to make sure the object was\ndefined in the first place. Handy for this sort of thing:\n\nmy $obj = Some::Module->new;\nisaok( $obj, 'Some::Module' );\n\nwhere you'd otherwise have to write\n\nmy $obj = Some::Module->new;\nok( defined $obj && $obj->isa('Some::Module') );\n\nto safeguard against your test script blowing up.\n\nYou can also test a class, to make sure that it has the right ancestor:\n\nisaok( 'Vole', 'Rodent' );\n\nIt works on references, too:\n\nisaok( $arrayref, 'ARRAY' );\n\nThe diagnostics of this test normally just refer to 'the object'. If you'd like them to be\nmore specific, you can supply an $objectname (for example 'Test customer').\n\nnewok\nmy $obj = newok( $class );\nmy $obj = newok( $class => \\@args );\nmy $obj = newok( $class => \\@args, $objectname );\n\nA convenience function which combines creating an object and calling \"isaok()\" on that\nobject.\n\nIt is basically equivalent to:\n\nmy $obj = $class->new(@args);\nisaok $obj, $class, $objectname;\n\nIf @args is not given, an empty list will be used.\n\nThis function only works on \"new()\" and it assumes \"new()\" will return just a single object\nwhich isa $class.\n\nsubtest\nsubtest $name => \\&code, @args;\n\n\"subtest()\" runs the &code as its own little test with its own plan and its own result. The\nmain test counts this as a single test using the result of the whole subtest to determine if\nits ok or not ok.\n\nFor example...\n\nuse Test::More tests => 3;\n\npass(\"First test\");\n\nsubtest 'An example subtest' => sub {\nplan tests => 2;\n\npass(\"This is a subtest\");\npass(\"So is this\");\n};\n\npass(\"Third test\");\n\nThis would produce.\n\n1..3\nok 1 - First test\n# Subtest: An example subtest\n1..2\nok 1 - This is a subtest\nok 2 - So is this\nok 2 - An example subtest\nok 3 - Third test\n\nA subtest may call \"skipall\". No tests will be run, but the subtest is considered a skip.\n\nsubtest 'skippy' => sub {\nplan skipall => 'cuz I said so';\npass('this test will never be run');\n};\n\nReturns true if the subtest passed, false otherwise.\n\nDue to how subtests work, you may omit a plan if you desire. This adds an implicit\n\"donetesting()\" to the end of your subtest. The following two subtests are equivalent:\n\nsubtest 'subtest with implicit donetesting()', sub {\nok 1, 'subtests with an implicit done testing should work';\nok 1, '... and support more than one test';\nok 1, '... no matter how many tests are run';\n};\n\nsubtest 'subtest with explicit donetesting()', sub {\nok 1, 'subtests with an explicit done testing should work';\nok 1, '... and support more than one test';\nok 1, '... no matter how many tests are run';\ndonetesting();\n};\n\nExtra arguments given to \"subtest\" are passed to the callback. For example:\n\nsub mysubtest {\nmy $range = shift;\n...\n}\n\nfor my $range (1, 10, 100, 1000) {\nsubtest \"testing range $range\", \\&mysubtest, $range;\n}\n\npass\nfail\npass($testname);\nfail($testname);\n\nSometimes you just want to say that the tests have passed. Usually the case is you've got\nsome complicated condition that is difficult to wedge into an \"ok()\". In this case, you can\nsimply use \"pass()\" (to declare the test ok) or fail (for not ok). They are synonyms for\nok(1) and ok(0).\n\nUse these very, very, very sparingly.\n"
                    },
                    {
                        "name": "Module tests",
                        "content": "Sometimes you want to test if a module, or a list of modules, can successfully load. For\nexample, you'll often want a first test which simply loads all the modules in the distribution\nto make sure they work before going on to do more complicated testing.\n\nFor such purposes we have \"useok\" and \"requireok\".\n\nrequireok\nrequireok($module);\nrequireok($file);\n\nTries to \"require\" the given $module or $file. If it loads successfully, the test will pass.\nOtherwise it fails and displays the load error.\n\n\"requireok\" will guess whether the input is a module name or a filename.\n\nNo exception will be thrown if the load fails.\n\n# require Some::Module\nrequireok \"Some::Module\";\n\n# require \"Some/File.pl\";\nrequireok \"Some/File.pl\";\n\n# stop testing if any of your modules will not load\nfor my $module (@module) {\nrequireok $module or BAILOUT \"Can't load $module\";\n}\n\nuseok\nBEGIN { useok($module); }\nBEGIN { useok($module, @imports); }\n\nLike \"requireok\", but it will \"use\" the $module in question and only loads modules, not\nfiles.\n\nIf you just want to test a module can be loaded, use \"requireok\".\n\nIf you just want to load a module in a test, we recommend simply using \"use\" directly. It\nwill cause the test to stop.\n\nIt's recommended that you run \"useok()\" inside a BEGIN block so its functions are exported\nat compile-time and prototypes are properly honored.\n\nIf @imports are given, they are passed through to the use. So this:\n\nBEGIN { useok('Some::Module', qw(foo bar)) }\n\nis like doing this:\n\nuse Some::Module qw(foo bar);\n\nVersion numbers can be checked like so:\n\n# Just like \"use Some::Module 1.02\"\nBEGIN { useok('Some::Module', 1.02) }\n\nDon't try to do this:\n\nBEGIN {\nuseok('Some::Module');\n\n...some code that depends on the use...\n...happening at compile time...\n}\n\nbecause the notion of \"compile-time\" is relative. Instead, you want:\n\nBEGIN { useok('Some::Module') }\nBEGIN { ...some code that depends on the use... }\n\nIf you want the equivalent of \"use Foo ()\", use a module but not import anything, use\n\"requireok\".\n\nBEGIN { requireok \"Foo\" }\n"
                    },
                    {
                        "name": "Complex data structures",
                        "content": "Not everything is a simple eq check or regex. There are times you need to see if two data\nstructures are equivalent. For these instances Test::More provides a handful of useful\nfunctions.\n\nNOTE I'm not quite sure what will happen with filehandles.\n\nisdeeply\nisdeeply( $got, $expected, $testname );\n\nSimilar to \"is()\", except that if $got and $expected are references, it does a deep\ncomparison walking each data structure to see if they are equivalent. If the two structures\nare different, it will display the place where they start differing.\n\n\"isdeeply()\" compares the dereferenced values of references, the references themselves\n(except for their type) are ignored. This means aspects such as blessing and ties are not\nconsidered \"different\".\n\n\"isdeeply()\" currently has very limited handling of function reference and globs. It merely\nchecks if they have the same referent. This may improve in the future.\n\nTest::Differences and Test::Deep provide more in-depth functionality along these lines.\n\nNOTE isdeeply() has limitations when it comes to comparing strings and refs:\n\nmy $path = path('.');\nmy $hash = {};\nisdeeply( $path, \"$path\" ); # ok\nisdeeply( $hash, \"$hash\" ); # fail\n\nThis happens because isdeeply will unoverload all arguments unconditionally. It is probably\nbest not to use isdeeply with overloading. For legacy reasons this is not likely to ever be\nfixed. If you would like a much better tool for this you should see Test2::Suite\nSpecifically Test2::Tools::Compare has an \"is()\" function that works like \"isdeeply\" with\nmany improvements.\n"
                    },
                    {
                        "name": "Diagnostics",
                        "content": "If you pick the right test function, you'll usually get a good idea of what went wrong when it\nfailed. But sometimes it doesn't work out that way. So here we have ways for you to write your\nown diagnostic messages which are safer than just \"print STDERR\".\n\ndiag\ndiag(@diagnosticmessage);\n\nPrints a diagnostic message which is guaranteed not to interfere with test output. Like\n\"print\" @diagnosticmessage is simply concatenated together.\n\nReturns false, so as to preserve failure.\n\nHandy for this sort of thing:\n\nok( grep(/foo/, @users), \"There's a foo user\" ) or\ndiag(\"Since there's no foo, check that /etc/bar is set up right\");\n\nwhich would produce:\n\nnot ok 42 - There's a foo user\n#   Failed test 'There's a foo user'\n#   in foo.t at line 52.\n# Since there's no foo, check that /etc/bar is set up right.\n\nYou might remember \"ok() or diag()\" with the mnemonic \"open() or die()\".\n\nNOTE The exact formatting of the diagnostic output is still changing, but it is guaranteed\nthat whatever you throw at it won't interfere with the test.\n\nnote\nnote(@diagnosticmessage);\n\nLike \"diag()\", except the message will not be seen when the test is run in a harness. It\nwill only be visible in the verbose TAP stream.\n\nHandy for putting in notes which might be useful for debugging, but don't indicate a\nproblem.\n\nnote(\"Tempfile is $tempfile\");\n\nexplain\nmy @dump = explain @diagnosticmessage;\n\nWill dump the contents of any references in a human readable format. Usually you want to\npass this into \"note\" or \"diag\".\n\nHandy for things like...\n\nisdeeply($have, $want) || diag explain $have;\n\nor\n\nnote explain \\%args;\nSome::Class->method(%args);\n"
                    },
                    {
                        "name": "Conditional tests",
                        "content": "Sometimes running a test under certain conditions will cause the test script to die. A certain\nfunction or method isn't implemented (such as \"fork()\" on MacOS), some resource isn't available\n(like a net connection) or a module isn't available. In these cases it's necessary to skip\ntests, or declare that they are supposed to fail but will work in the future (a todo test).\n\nFor more details on the mechanics of skip and todo tests see Test::Harness.\n\nThe way Test::More handles this is with a named block. Basically, a block of tests which can be\nskipped over or made todo. It's best if I just show you...\n\nSKIP: BLOCK\nSKIP: {\nskip $why, $howmany if $condition;\n\n...normal testing code goes here...\n}\n\nThis declares a block of tests that might be skipped, $howmany tests there are, $why and\nunder what $condition to skip them. An example is the easiest way to illustrate:\n\nSKIP: {\neval { require HTML::Lint };\n\nskip \"HTML::Lint not installed\", 2 if $@;\n\nmy $lint = new HTML::Lint;\nisaok( $lint, \"HTML::Lint\" );\n\n$lint->parse( $html );\nis( $lint->errors, 0, \"No errors found in HTML\" );\n}\n\nIf the user does not have HTML::Lint installed, the whole block of code *won't be run at\nall*. Test::More will output special ok's which Test::Harness interprets as skipped, but\npassing, tests.\n\nIt's important that $howmany accurately reflects the number of tests in the SKIP block so\nthe # of tests run will match up with your plan. If your plan is \"noplan\" $howmany is\noptional and will default to 1.\n\nIt's perfectly safe to nest SKIP blocks. Each SKIP block must have the label \"SKIP\", or\nTest::More can't work its magic.\n\nYou don't skip tests which are failing because there's a bug in your program, or for which\nyou don't yet have code written. For that you use TODO. Read on.\n\nTODO: BLOCK\nTODO: {\nlocal $TODO = $why if $condition;\n\n...normal testing code goes here...\n}\n\nDeclares a block of tests you expect to fail and $why. Perhaps it's because you haven't\nfixed a bug or haven't finished a new feature:\n\nTODO: {\nlocal $TODO = \"URI::Geller not finished\";\n\nmy $card = \"Eight of clubs\";\nis( URI::Geller->yourcard, $card, 'Is THIS your card?' );\n\nmy $spoon;\nURI::Geller->bendspoon;\nis( $spoon, 'bent',    \"Spoon bending, that's original\" );\n}\n\nWith a todo block, the tests inside are expected to fail. Test::More will run the tests\nnormally, but print out special flags indicating they are \"todo\". Test::Harness will\ninterpret failures as being ok. Should anything succeed, it will report it as an unexpected\nsuccess. You then know the thing you had todo is done and can remove the TODO flag.\n\nThe nice part about todo tests, as opposed to simply commenting out a block of tests, is\nthat it is like having a programmatic todo list. You know how much work is left to be done,\nyou're aware of what bugs there are, and you'll know immediately when they're fixed.\n\nOnce a todo test starts succeeding, simply move it outside the block. When the block is\nempty, delete it.\n\ntodoskip\nTODO: {\ntodoskip $why, $howmany if $condition;\n\n...normal testing code...\n}\n\nWith todo tests, it's best to have the tests actually run. That way you'll know when they\nstart passing. Sometimes this isn't possible. Often a failing test will cause the whole\nprogram to die or hang, even inside an \"eval BLOCK\" with and using \"alarm\". In these extreme\ncases you have no choice but to skip over the broken tests entirely.\n\nThe syntax and behavior is similar to a \"SKIP: BLOCK\" except the tests will be marked as\nfailing but todo. Test::Harness will interpret them as passing.\n\nWhen do I use SKIP vs. TODO?\nIf it's something the user might not be able to do, use SKIP. This includes optional modules\nthat aren't installed, running under an OS that doesn't have some feature (like \"fork()\" or\nsymlinks), or maybe you need an Internet connection and one isn't available.\n\nIf it's something the programmer hasn't done yet, use TODO. This is for any code you haven't\nwritten yet, or bugs you have yet to fix, but want to put tests in your testing script\n(always a good idea).\n"
                    },
                    {
                        "name": "Test control",
                        "content": "BAILOUT\nBAILOUT($reason);\n\nIndicates to the harness that things are going so badly all testing should terminate. This\nincludes the running of any additional test scripts.\n\nThis is typically used when testing cannot continue such as a critical module failing to\ncompile or a necessary external utility not being available such as a database connection\nfailing.\n\nThe test will exit with 255.\n\nFor even better control look at Test::Most.\n"
                    },
                    {
                        "name": "Discouraged comparison functions",
                        "content": "The use of the following functions is discouraged as they are not actually testing functions and\nproduce no diagnostics to help figure out what went wrong. They were written before\n\"isdeeply()\" existed because I couldn't figure out how to display a useful diff of two\narbitrary data structures.\n\nThese functions are usually used inside an \"ok()\".\n\nok( eqarray(\\@got, \\@expected) );\n\n\"isdeeply()\" can do that better and with diagnostics.\n\nisdeeply( \\@got, \\@expected );\n\nThey may be deprecated in future versions.\n\neqarray\nmy $iseq = eqarray(\\@got, \\@expected);\n\nChecks if two arrays are equivalent. This is a deep check, so multi-level structures are\nhandled correctly.\n\neqhash\nmy $iseq = eqhash(\\%got, \\%expected);\n\nDetermines if the two hashes contain the same keys and values. This is a deep check.\n\neqset\nmy $iseq = eqset(\\@got, \\@expected);\n\nSimilar to \"eqarray()\", except the order of the elements is not important. This is a deep\ncheck, but the irrelevancy of order only applies to the top level.\n\nok( eqset(\\@got, \\@expected) );\n\nIs better written:\n\nisdeeply( [sort @got], [sort @expected] );\n\nNOTE By historical accident, this is not a true set comparison. While the order of elements\ndoes not matter, duplicate elements do.\n\nNOTE \"eqset()\" does not know how to deal with references at the top level. The following is\nan example of a comparison which might not work:\n\neqset([\\1, \\2], [\\2, \\1]);\n\nTest::Deep contains much better set comparison functions.\n"
                    },
                    {
                        "name": "Extending and Embedding Test::More",
                        "content": "Sometimes the Test::More interface isn't quite enough. Fortunately, Test::More is built on top\nof Test::Builder which provides a single, unified backend for any test library to use. This\nmeans two test libraries which both use <Test::Builder> can be used together in the same\nprogram>.\n\nIf you simply want to do a little tweaking of how the tests behave, you can access the\nunderlying Test::Builder object like so:\n\nbuilder\nmy $testbuilder = Test::More->builder;\n\nReturns the Test::Builder object underlying Test::More for you to play with.\n"
                    }
                ]
            },
            "EXIT CODES": {
                "content": "If all your tests passed, Test::Builder will exit with zero (which is normal). If anything\nfailed it will exit with how many failed. If you run less (or more) tests than you planned, the\nmissing (or extras) will be considered failures. If no tests were ever run Test::Builder will\nthrow a warning and exit with 255. If the test died, even after having successfully completed\nall its tests, it will still be considered a failure and will exit with 255.\n\nSo the exit codes are...\n\n0                   all tests successful\n255                 test died or all passed but wrong # of tests run\nany other number    how many failed (including missing or extras)\n\nIf you fail more than 254 tests, it will be reported as 254.\n\nNOTE This behavior may go away in future versions.\n",
                "subsections": []
            },
            "COMPATIBILITY": {
                "content": "Test::More works with Perls as old as 5.8.1.\n\nThread support is not very reliable before 5.10.1, but that's because threads are not very\nreliable before 5.10.1.\n\nAlthough Test::More has been a core module in versions of Perl since 5.6.2, Test::More has\nevolved since then, and not all of the features you're used to will be present in the shipped\nversion of Test::More. If you are writing a module, don't forget to indicate in your package\nmetadata the minimum version of Test::More that you require. For instance, if you want to use\n\"donetesting()\" but want your test script to run on Perl 5.10.0, you will need to explicitly\nrequire Test::More > 0.88.\n\nKey feature milestones include:\n\nsubtests\nSubtests were released in Test::More 0.94, which came with Perl 5.12.0. Subtests did not\nimplicitly call \"donetesting()\" until 0.96; the first Perl with that fix was Perl 5.14.0\nwith 0.98.\n\n\"donetesting()\"\nThis was released in Test::More 0.88 and first shipped with Perl in 5.10.1 as part of\nTest::More 0.92.\n\n\"cmpok()\"\nAlthough \"cmpok()\" was introduced in 0.40, 0.86 fixed an important bug to make it safe for\noverloaded objects; the fixed first shipped with Perl in 5.10.1 as part of Test::More 0.92.\n\n\"newok()\" \"note()\" and \"explain()\"\nThese were was released in Test::More 0.82, and first shipped with Perl in 5.10.1 as part of\nTest::More 0.92.\n\nThere is a full version history in the Changes file, and the Test::More versions included as\ncore can be found using Module::CoreList:\n\n$ corelist -a Test::More\n\nCAVEATS and NOTES\nutf8 / \"Wide character in print\"\nIf you use utf8 or other non-ASCII characters with Test::More you might get a \"Wide\ncharacter in print\" warning. Using \"binmode STDOUT, \":utf8\"\" will not fix it. Test::Builder\n(which powers Test::More) duplicates STDOUT and STDERR. So any changes to them, including\nchanging their output disciplines, will not be seen by Test::More.\n\nOne work around is to apply encodings to STDOUT and STDERR as early as possible and before\nTest::More (or any other Test module) loads.\n\nuse open ':std', ':encoding(utf8)';\nuse Test::More;\n\nA more direct work around is to change the filehandles used by Test::Builder.\n\nmy $builder = Test::More->builder;\nbinmode $builder->output,         \":encoding(utf8)\";\nbinmode $builder->failureoutput, \":encoding(utf8)\";\nbinmode $builder->todooutput,    \":encoding(utf8)\";\n\nOverloaded objects\nString overloaded objects are compared as strings (or in \"cmpok()\"'s case, strings or\nnumbers as appropriate to the comparison op). This prevents Test::More from piercing an\nobject's interface allowing better blackbox testing. So if a function starts returning\noverloaded objects instead of bare strings your tests won't notice the difference. This is\ngood.\n\nHowever, it does mean that functions like \"isdeeply()\" cannot be used to test the internals\nof string overloaded objects. In this case I would suggest Test::Deep which contains more\nflexible testing functions for complex data structures.\n\nThreads\nTest::More will only be aware of threads if \"use threads\" has been done *before* Test::More\nis loaded. This is ok:\n\nuse threads;\nuse Test::More;\n\nThis may cause problems:\n\nuse Test::More\nuse threads;\n\n5.8.1 and above are supported. Anything below that has too many bugs.\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "This is a case of convergent evolution with Joshua Pritikin's Test module. I was largely unaware\nof its existence when I'd first written my own \"ok()\" routines. This module exists because I\ncan't figure out how to easily wedge test names into Test's interface (along with a few other\nproblems).\n\nThe goal here is to have a testing utility that's simple to learn, quick to use and difficult to\ntrip yourself up with while still providing more flexibility than the existing Test.pm. As such,\nthe names of the most common routines are kept tiny, special cases and magic side-effects are\nkept to a minimum. WYSIWYG.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "ALTERNATIVES\nTest2::Suite is the most recent and modern set of tools for testing.\n\nTest::Simple if all this confuses you and you just want to write some tests. You can upgrade to\nTest::More later (it's forward compatible).\n\nTest::Legacy tests written with Test.pm, the original testing module, do not play well with\nother testing libraries. Test::Legacy emulates the Test.pm interface and does play well with\nothers.\n\nADDITIONAL LIBRARIES\nTest::Differences for more ways to test complex data structures. And it plays well with\nTest::More.\n\nTest::Class is like xUnit but more perlish.\n\nTest::Deep gives you more powerful complex data structure testing.\n\nTest::Inline shows the idea of embedded testing.\n\nMock::Quick The ultimate mocking library. Easily spawn objects defined on the fly. Can also\noverride, block, or reimplement packages as needed.\n\nTest::FixtureBuilder Quickly define fixture data for unit tests.\n\nOTHER COMPONENTS\nTest::Harness is the test runner and output interpreter for Perl. It's the thing that powers\n\"make test\" and where the \"prove\" utility comes from.\n\nBUNDLES\nTest::Most Most commonly needed test functions and features.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Michael G Schwern <schwern@pobox.com> with much inspiration from Joshua Pritikin's Test module\nand lots of help from Barrie Slaymaker, Tony Bowden, blackstar.co.uk, chromatic, Fergal Daly and\nthe perl-qa gang.\n",
                "subsections": []
            },
            "MAINTAINERS": {
                "content": "Chad Granum <exodist@cpan.org>\n",
                "subsections": []
            },
            "BUGS": {
                "content": "See https://github.com/Test-More/test-more/issues to report and view bugs.\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "The source code repository for Test::More can be found at\nhttp://github.com/Test-More/test-more/.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2001-2008 by Michael G Schwern <schwern@pobox.com>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nSee http://www.perl.com/perl/misc/Artistic.html\n",
                "subsections": []
            }
        }
    }
}