{
    "content": [
        {
            "type": "text",
            "text": "# Test::Unit::Assert (perldoc)\n\n## NAME\n\nTest::Unit::Assert - unit testing framework assertion class\n\n## SYNOPSIS\n\n# this class is not intended to be used directly,\n# normally you get the functionality by subclassing from\n# Test::Unit::TestCase\nuse Test::Unit::TestCase;\n# more code here ...\n$self->assert($yourconditionhere, $youroptionalmessagehere);\n# or, for regular expression comparisons:\n$self->assert(qr/somepattern/, $result);\n# or, for functional style coderef tests:\n$self->assert(sub {\n$[0] == $[1]\nor $self->fail(\"Expected $[0], got $[1]\");\n}, 1, 2);\n# or, for old style regular expression comparisons\n# (strongly deprecated; see warning below)\n$self->assert(scalar(\"foo\" =~ /bar/), $youroptionalmessagehere);\n# Or, if you don't mind us guessing\n$self->assertequals('expected', $actual [, $optionalmessage]);\n$self->assertequals(1,$actual);\n$self->assertnotequals('not expected', $actual [, $optionalmessage]);\n$self->assertnotequals(0,1);\n# Or, if you want to force the comparator\n$self->assertnumequals(1,1);\n$self->assertnumnotequals(1,0);\n$self->assertstrequals('string','string');\n$self->assertstrnotequals('stringA', 'stringB');\n# assert defined/undefined status\n$self->assertnull(undef);\n$self->assertnotnull('');\n\n## DESCRIPTION\n\nThis class contains the various standard assertions used within the framework. With the\nexception of the \"assert(CODEREF, @ARGS)\", all the assertion methods take an optional message\nafter the mandatory fields. The message can either be a single string, or a list, which will get\nconcatenated.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (11 subsections)\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Test::Unit::Assert",
        "section": "",
        "mode": "perldoc",
        "summary": "Test::Unit::Assert - unit testing framework assertion class",
        "synopsis": "# this class is not intended to be used directly,\n# normally you get the functionality by subclassing from\n# Test::Unit::TestCase\nuse Test::Unit::TestCase;\n# more code here ...\n$self->assert($yourconditionhere, $youroptionalmessagehere);\n# or, for regular expression comparisons:\n$self->assert(qr/somepattern/, $result);\n# or, for functional style coderef tests:\n$self->assert(sub {\n$[0] == $[1]\nor $self->fail(\"Expected $[0], got $[1]\");\n}, 1, 2);\n# or, for old style regular expression comparisons\n# (strongly deprecated; see warning below)\n$self->assert(scalar(\"foo\" =~ /bar/), $youroptionalmessagehere);\n# Or, if you don't mind us guessing\n$self->assertequals('expected', $actual [, $optionalmessage]);\n$self->assertequals(1,$actual);\n$self->assertnotequals('not expected', $actual [, $optionalmessage]);\n$self->assertnotequals(0,1);\n# Or, if you want to force the comparator\n$self->assertnumequals(1,1);\n$self->assertnumnotequals(1,0);\n$self->assertstrequals('string','string');\n$self->assertstrnotequals('stringA', 'stringB');\n# assert defined/undefined status\n$self->assertnull(undef);\n$self->assertnotnull('');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": [
                    {
                        "name": "Methods",
                        "lines": 1
                    },
                    {
                        "name": "assert_equals",
                        "lines": 1
                    },
                    {
                        "name": "assert_not_equals",
                        "lines": 15
                    },
                    {
                        "name": "assert_matches",
                        "lines": 1
                    },
                    {
                        "name": "assert_does_not_match",
                        "lines": 2
                    },
                    {
                        "name": "assert_deep_equals",
                        "lines": 7
                    },
                    {
                        "name": "assert_null",
                        "lines": 1
                    },
                    {
                        "name": "assert_not_null",
                        "lines": 21
                    },
                    {
                        "name": "assert_raises",
                        "lines": 2
                    },
                    {
                        "name": "multi_assert",
                        "lines": 2
                    },
                    {
                        "name": "ok",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 14,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Test::Unit::Assert - unit testing framework assertion class\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# this class is not intended to be used directly,\n# normally you get the functionality by subclassing from\n# Test::Unit::TestCase\n\nuse Test::Unit::TestCase;\n\n# more code here ...\n\n$self->assert($yourconditionhere, $youroptionalmessagehere);\n\n# or, for regular expression comparisons:\n$self->assert(qr/somepattern/, $result);\n\n# or, for functional style coderef tests:\n$self->assert(sub {\n$[0] == $[1]\nor $self->fail(\"Expected $[0], got $[1]\");\n}, 1, 2);\n\n# or, for old style regular expression comparisons\n# (strongly deprecated; see warning below)\n$self->assert(scalar(\"foo\" =~ /bar/), $youroptionalmessagehere);\n\n# Or, if you don't mind us guessing\n$self->assertequals('expected', $actual [, $optionalmessage]);\n$self->assertequals(1,$actual);\n$self->assertnotequals('not expected', $actual [, $optionalmessage]);\n$self->assertnotequals(0,1);\n\n# Or, if you want to force the comparator\n$self->assertnumequals(1,1);\n$self->assertnumnotequals(1,0);\n$self->assertstrequals('string','string');\n$self->assertstrnotequals('stringA', 'stringB');\n\n# assert defined/undefined status\n$self->assertnull(undef);\n$self->assertnotnull('');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class contains the various standard assertions used within the framework. With the\nexception of the \"assert(CODEREF, @ARGS)\", all the assertion methods take an optional message\nafter the mandatory fields. The message can either be a single string, or a list, which will get\nconcatenated.\n\nAlthough you can specify a message, it is hoped that the default error messages generated when\nan assertion fails will be good enough for most cases.\n",
                "subsections": [
                    {
                        "name": "Methods",
                        "content": ""
                    },
                    {
                        "name": "assert_equals",
                        "content": ""
                    },
                    {
                        "name": "assert_not_equals",
                        "content": "The catch all assertions of (in)equality. We make a guess about whether to test for numeric\nor string (in)equality based on the first argument. If it looks like a number then we do a\nnumeric test, if it looks like a string, we do a string test.\n\nIf the first argument is an object, we check to see if the '==' operator has been overloaded\nand use that if it has, otherwise we do the string test.\n\nassertnumequals\nassertnumnotequals\nForce numeric comparison with these two.\n\nassertstrequals\nassertstrnotequals\nForce string comparison\n"
                    },
                    {
                        "name": "assert_matches",
                        "content": ""
                    },
                    {
                        "name": "assert_does_not_match",
                        "content": "Assert that STRING does or does not match the PATTERN regex.\n"
                    },
                    {
                        "name": "assert_deep_equals",
                        "content": "Assert that reference A is a deep copy of reference B. The references can be complex, deep\nstructures. If they are different, the default message will display the place where they\nstart differing.\n\nNOTE This is NOT well-tested on circular references. Nor am I quite sure what will happen\nwith filehandles.\n"
                    },
                    {
                        "name": "assert_null",
                        "content": ""
                    },
                    {
                        "name": "assert_not_null",
                        "content": "Assert that ARG is defined or not defined.\n\nassert(BOOLEAN [, MESSAGE])\nChecks if the BOOLEAN expression returns a true value that is neither a CODE ref nor a\nREGEXP. Note that MESSAGE is almost non optional in this case, otherwise all the assertion\nhas to go on is the truth or otherwise of the boolean.\n\nIf you want to use the \"old\" style for testing regular expression matching, please be aware\nof this: the arguments to assert() are evaluated in list context, e.g. making a failing\nregex \"pull\" the message into the place of the first argument. Since this is usually just\nplain wrong, please use scalar() to force the regex comparison to yield a useful boolean\nvalue.\n\nassert(qr/PATTERN/, ACTUAL [, MESSAGE])\nMatches ACTUAL against the PATTERN regex. If you omit MESSAGE, you should get a sensible\nerror message.\n\nassert(CODEREF, @ARGS)\nCalls CODEREF->(@ARGS). Assertion fails if this returns false (or throws\nTest::Unit::Failure)\n"
                    },
                    {
                        "name": "assert_raises",
                        "content": "Calls CODEREF->(). Assertion fails unless an exception of class EXCEPTIONCLASS is raised.\n"
                    },
                    {
                        "name": "multi_assert",
                        "content": "Calls $self->assert(ASSERTION, @$ARGSET) for each $ARGSET in @ARGSETS.\n"
                    },
                    {
                        "name": "ok",
                        "content": "Simulates the behaviour of the Test module. Deprecated.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Copyright (c) 2000-2002, 2005 the PerlUnit Development Team (see Test::Unit or the AUTHORS file\nincluded in this distribution).\n\nAll rights reserved. This program is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "*   Test::Unit::Assertion\n\n*   Test::Unit::Assertion::Regexp\n\n*   Test::Unit::Assertion::CodeRef\n\n*   Test::Unit::Assertion::Boolean\n\n*   Test::Unit::TestCase\n\n*   Test::Unit::Exception\n\n*   The framework self-testing suite (t::tlib::AllTests)\n",
                "subsections": []
            }
        }
    }
}