{
    "content": [
        {
            "type": "text",
            "text": "# Test::Unit::Procedural (perldoc)\n\n## NAME\n\nTest::Unit::Procedural - Procedural style unit testing interface\n\n## SYNOPSIS\n\nuse Test::Unit::Procedural;\n# your code to be tested goes here\nsub foo { return 23 };\nsub bar { return 42 };\n# define tests\nsub testfoo { assert(foo() == 23, \"Your message here\"); }\nsub testbar { assert(bar() == 42, \"I will be printed if this fails\"); }\n# setup and teardown are used to\n# prepare and release resources need for testing\nsub setup    { print \"hello world\\n\"; }\nsub teardown { print \"leaving world again\\n\"; }\n# run your test\ncreatesuite();\nrunsuite();\n\n## DESCRIPTION\n\nTest::Unit::Procedural is the procedural style interface to a sophisticated unit testing\nframework for Perl that is derived from the JUnit testing framework for Java by Kent Beck and\nErich Gamma. While this framework is originally intended to support unit testing in an\nobject-oriented development paradigm (with support for inheritance of tests etc.),\nTest::Unit::Procedural is intended to provide a simpler interface to the framework that is more\nsuitable for use in a scripting style environment. Therefore, Test::Unit::Procedural does not\nprovide much support for an object-oriented approach to unit testing - if you want that, please\nhave a look at Test::Unit::TestCase.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (3 subsections)\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Test::Unit::Procedural",
        "section": "",
        "mode": "perldoc",
        "summary": "Test::Unit::Procedural - Procedural style unit testing interface",
        "synopsis": "use Test::Unit::Procedural;\n# your code to be tested goes here\nsub foo { return 23 };\nsub bar { return 42 };\n# define tests\nsub testfoo { assert(foo() == 23, \"Your message here\"); }\nsub testbar { assert(bar() == 42, \"I will be printed if this fails\"); }\n# setup and teardown are used to\n# prepare and release resources need for testing\nsub setup    { print \"hello world\\n\"; }\nsub teardown { print \"leaving world again\\n\"; }\n# run your test\ncreatesuite();\nrunsuite();",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": [
                    {
                        "name": "create_suite",
                        "lines": 2
                    },
                    {
                        "name": "run_suite",
                        "lines": 2
                    },
                    {
                        "name": "add_suite",
                        "lines": 14
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Test::Unit::Procedural - Procedural style unit testing interface\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Test::Unit::Procedural;\n\n# your code to be tested goes here\n\nsub foo { return 23 };\nsub bar { return 42 };\n\n# define tests\n\nsub testfoo { assert(foo() == 23, \"Your message here\"); }\nsub testbar { assert(bar() == 42, \"I will be printed if this fails\"); }\n\n# setup and teardown are used to\n# prepare and release resources need for testing\n\nsub setup    { print \"hello world\\n\"; }\nsub teardown { print \"leaving world again\\n\"; }\n\n# run your test\n\ncreatesuite();\nrunsuite();\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Test::Unit::Procedural is the procedural style interface to a sophisticated unit testing\nframework for Perl that is derived from the JUnit testing framework for Java by Kent Beck and\nErich Gamma. While this framework is originally intended to support unit testing in an\nobject-oriented development paradigm (with support for inheritance of tests etc.),\nTest::Unit::Procedural is intended to provide a simpler interface to the framework that is more\nsuitable for use in a scripting style environment. Therefore, Test::Unit::Procedural does not\nprovide much support for an object-oriented approach to unit testing - if you want that, please\nhave a look at Test::Unit::TestCase.\n\nYou test a given unit (a script, a module, whatever) by using Test::Unit::Procedural, which\nexports the following routines into your namespace:\n\nassert()\nused to assert that a boolean condition is true\n",
                "subsections": [
                    {
                        "name": "create_suite",
                        "content": "used to create a test suite consisting of all methods with a name prefix of \"test\"\n"
                    },
                    {
                        "name": "run_suite",
                        "content": "runs the test suite (text output)\n"
                    },
                    {
                        "name": "add_suite",
                        "content": "used to add test suites to each other\n\nFor convenience, \"createsuite()\" will automatically build a test suite for a given package.\nThis will build a test case for each subroutine in the package given that has a name starting\nwith \"test\" and pack them all together into one TestSuite object for easy testing. If you don't\ngive a package name to \"createsuite()\", the current package is taken as default.\n\nTest output is one status line (a \".\" for every successful test run, or an \"F\" for any failed\ntest run, to indicate progress), one result line (\"OK\" or \"!!!FAILURES!!!\"), and possibly many\nlines reporting detailed error messages for any failed tests.\n\nPlease remember, Test::Unit::Procedural is intended to be a simple and convenient interface. If\nyou need more functionality, take the object-oriented approach outlined in Test::Unit::TestCase.\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::TestCase\n\n*   the procedural style examples in the examples directory\n",
                "subsections": []
            }
        }
    }
}