logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test::Regexp::Pattern - Test Regexp::Pattern patterns

Acknowledgements

       Some code taken from Test::Pod::Coverage by Andy Lester.

Author

       perlancar <perlancar@cpan.org>

Bugs

       Please    report    any    bugs     or     feature     requests     on     the     bugtracker     website
       <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Regexp-Pattern>

       When  submitting  a  bug  or request, please include a test-file or a patch to an existing test-file that
       illustrates the bug or desired feature.

perl v5.36.0                                       2022-10-08                         Test::Regexp::Pattern(3pm)

Contributing

       To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

       Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then
       test via:

        % prove -l

       If you want to build the distribution (e.g. to try to install it locally on your system), you can install
       Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one  or  two  other  Dist::Zilla
       plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can
       be reported to me.

Description

       This module performs various checks on a module's Regexp::Pattern patterns.  It is recommended that you
       include something like the above "release-regexp-pattern.t" in your distribution if you add regexp
       patterns to your code. If you use Dist::Zilla to build your distribution, there is a [Regexp::Pattern]
       plugin which automatically adds this release test file during build.

Functions

       All these functions are exported by default.

   regexp_patterns_in_module_ok($module[,\%opts][,$msg])
       Load $module and perform test for regexp patterns (%RE) in the module.

       Available options:

       •   test_examples => bool (default: 1)

   regexp_patterns_in_all_modules_ok([\%opts][,$msg])
       Look    for   modules   in   directory   "lib"   (or   "blib"   instead,   if   it   exists),   and   run
       "regexp_patterns_in_module_ok()" against each of them.

       Options are the same as in "regexp_patterns_in_module_ok()".

Homepage

       Please visit the project's homepage at <https://metacpan.org/release/Test-Regexp-Pattern>.

Name

       Test::Regexp::Pattern - Test Regexp::Pattern patterns

See Also

       test-regexp-pattern, a command-line interface for "regexp_patterns_in_all_modules_ok()".

       Regexp::Pattern

       Dist::Zilla::Plugin::Regexp::Pattern

Source

       Source repository is at <https://github.com/perlancar/perl-Test-Regexp-Pattern>.

Synopsis

       To check all regexp patterns in a module:

        use Test::Regexp::Pattern;
        regexp_patterns_in_module_ok("Foo::Bar", {opt => ...}, $msg);

       Alternatively, you can check all regexp patterns in all modules in a distro:

        # save in release-regexp-pattern.t, put in distro's t/ subdirectory
        use Test::More;
        plan skip_all => "Not release testing" unless $ENV{RELEASE_TESTING};
        eval "use Test::Regexp::Pattern";
        plan skip_all => "Test::Regexp::Pattern required for testing Regexp::Pattern patterns" if $@;
        regexp_patterns_in_all_modules_ok({opt => ...}, $msg);

Version

       This document describes version 0.010 of Test::Regexp::Pattern (from Perl distribution Test-Regexp-
       Pattern), released on 2022-07-24.

See Also