Test::...Pattern(3pm)
π NAME π
Okay bestie, welcome to the manual page for Test::Regexp::Pattern π β that's the 3pm one, from the User Contributed Perl Documentation. And what does it do?? It tests your Regexp::Pattern patterns. Yeah. It's a whole vibe check for your regexps. Periodt.
β¨ VERSION β¨
This doc describes version 0.010 of Test::Regexp::Pattern β that's from the Perl distribution Test-Regexp-Pattern, released on 2022-07-24. Mark your calendars, she's stable. π
π¦ SYNOPSIS π¦
So like, first scenario: you wanna check all the regexp patterns in one module. Do this:
use Test::Regexp::Pattern;
regexp_patterns_in_module_ok("Foo::Bar", {opt => ...}, $msg);
Or alternatively π«Ά β and this is the distro-wide energy β you can check all regexp patterns in all the modules across your whole 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);
Slay. π₯
πΈ DESCRIPTION πΈ
So this module runs various checks on a module's Regexp::Pattern patterns. That's the whole job, and she does it well.
The recommendation, lowkey strongly: if you add regexp patterns to your code, include something like that release-regexp-pattern.t up there in your distribution. Iconic move.
And ohh, if you build your distribution with Dist::Zilla, there's already a [Regexp::Pattern] plugin that automatically adds this release test file during build for you. No cap, it just handles it. π§
π ACKNOWLEDGEMENTS π
Some code was taken from Test::Pod::Coverage by Andy Lester. Giving credit where it's due, always. π«Ά
β FUNCTIONS β
Heads up: all of these functions are exported by default. You don't gotta ask nicely. β¨
regexp_patterns_in_module_ok($module [, \%opts ] [, $msg])
Load $module and perform the test for regexp patterns (%RE) in that module. Simple as that.
Available options:
test_examples=> bool β and the default is1. So she's on by default, bestie.
regexp_patterns_in_all_modules_ok([ \%opts ] [, $msg])
Look for modules in the directory lib β or, plot twist, in blib instead if it exists π β and then run regexp_patterns_in_module_ok() against each and every one of them. All of them. Everyone gets tested.
Options are the exact same as in regexp_patterns_in_module_ok().
π HOMEPAGE π
Please visit the project's homepage at https://metacpan.org/release/Test-Regexp-Pattern. Go say hi. π
π¦ SOURCE π¦
Source repository lives at https://github.com/perlancar/perl-Test-Regexp-Pattern. Come lurk, come contribute.
π SEE ALSO π
test-regexp-patternβ a command-line interface forregexp_patterns_in_all_modules_ok(). CLI girlies, this one's for you.Regexp::PatternDist::Zilla::Plugin::Regexp::Pattern
π AUTHOR π
perlancar <perlancar@cpan.org> β the main character, honestly. π
π«Ά CONTRIBUTING π«Ά
Wanna help out?? You absolutely can:
- Send patches by email / via RT, or
- Send pull requests on GitHub.
And here's the tea: most of the time, you don't need to build the distribution yourself. You can literally just modify the code, then test it via:
% prove -l
That's it. That's the workflow. π
But if you do want to build the distribution (like, say, to try installing 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 all that are considered a bug, and you can report them to me. Fr fr.
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2022, 2020, 2018 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in go off. π
π BUGS π
Please report any bugs or feature requests on the bugtracker website: https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Regexp-Pattern
And when you're submitting a bug or request, please include a test-file, or a patch to an existing test-file, that illustrates the bug or the desired feature. Because not me getting a report with zero repro steps π β help a sister out, bestie.
And that's the page!! π Wrapped up for you on 2022-10-08 by perl v5.36.0, which is what produced this particular Test::...Pattern(3pm) rendering. Mwah. πβ¨
π¦ where this page comes from
- ubuntu noble: libtest-regexp-pattern-perl 0.010-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-regexp-pattern-perl 0.010-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-regexp-pattern-perl 0.010-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms