{
    "mode": "perldoc",
    "parameter": "Test::TypeTiny",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Test%3A%3ATypeTiny/json",
    "generated": "2026-06-12T11:57:29Z",
    "synopsis": "use strict;\nuse warnings;\nuse Test::More;\nuse Test::TypeTiny;\nuse Types::Mine qw(Integer Number);\nshouldpass(1, Integer);\nshouldpass(-1, Integer);\nshouldpass(0, Integer);\nshouldfail(2.5, Integer);\noksubtype(Number, Integer);\ndonetesting;",
    "sections": {
        "NAME": {
            "content": "Test::TypeTiny - useful functions for testing the efficacy of type constraints\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use strict;\nuse warnings;\nuse Test::More;\nuse Test::TypeTiny;\n\nuse Types::Mine qw(Integer Number);\n\nshouldpass(1, Integer);\nshouldpass(-1, Integer);\nshouldpass(0, Integer);\nshouldfail(2.5, Integer);\n\noksubtype(Number, Integer);\n\ndonetesting;\n",
            "subsections": []
        },
        "STATUS": {
            "content": "This module is covered by the Type-Tiny stability policy.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Test::TypeTiny provides a few handy functions for testing type constraints.\n",
            "subsections": [
                {
                    "name": "Functions",
                    "content": "\"shouldpass($value, $type, $testname)\"\n\"shouldpass($value, $type)\"\nTest that passes iff $value passes \"$type->check\".\n\n\"shouldfail($value, $type, $testname)\"\n\"shouldfail($value, $type)\"\nTest that passes iff $value fails \"$type->check\".\n\n\"oksubtype($type, @subtypes)\"\nTest that passes iff all @subtypes are subtypes of $type.\n\n\"EXTENDEDTESTING\"\nExportable boolean constant.\n\n\"matchfor(@things)\"\nAssistant for matching exceptions. Not exported by default. See also Test::Fatal::matchfor.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "If the \"EXTENDEDTESTING\" environment variable is set to true, this module will promote each\n\"shouldpass\" or \"shouldfail\" test into a subtest block and test the type constraint in both an\ninlined and non-inlined manner.\n\nThis variable must be set at compile time (i.e. before this module is loaded).\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Type::Tiny.\n\nFor an alternative to \"shouldpass\", see Test::Deep::Type which will happily accept a Type::Tiny\ntype constraint instead of a MooseX::Types one.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Toby Inkster <tobyink@cpan.org>.\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENCE": {
            "content": "This software is copyright (c) 2013-2014, 2017-2021 by Toby Inkster.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        },
        "DISCLAIMER OF WARRANTIES": {
            "content": "THIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\nWITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.\n",
            "subsections": []
        }
    },
    "summary": "Test::TypeTiny - useful functions for testing the efficacy of type constraints",
    "flags": [],
    "examples": [],
    "see_also": []
}