Test::DZil(3)
π Test::DZil β the manual page, bestie π
okay so this is Test::DZil, page 3 of the User Contributed Perl Documentation section, and it is exactly the thing you want if you're out here testing Dist::Zilla plugins. no cap. let's get into it π«Ά
β¨ NAME β¨
Test::DZil β tools for testing Dist::Zilla plugins π§°
π VERSION π
version 6.040 β that's the one, periodt.
πΈ DESCRIPTION πΈ
Test::DZil provides routines for writing tests for Dist::Zilla plugins. that's it, that's the whole vibe: it's the test-writing toolkit, the backstage pass, the "let me help you test your plugin" bestie π
π¦ PERL VERSION π¦
okay so this module should work on any version of perl still receiving updates from the Perl 5 Porters. that means it should work on any version of perl released in the last two to three years. (that is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) slay.
although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so likeβ¦ don't come for the minimum perl version, it does what it wants π
π₯ FUNCTIONS π₯
π§ Builder
π§ Minter
my $tzil = Builder->from_config(...);
these return class names that subclass Dist::Zilla::Dist::Builder or Dist::Zilla::Dist::Minter, respectively, with the Dist::Zilla::Tester behavior added. two flavors, both iconic, both tester-fied π
π is_filelist
is_filelist( \@files_we_have, \@files_we_want, $desc );
this test assertion compares two arrayrefs of filenames, taking care of slash normalization and sorting. also: @files_we_have may also contain objects that do Dist::Zilla::Role::File. so you can throw actual file objects at it, she's flexible like that β¨
π is_yaml
is_yaml( $yaml_string, $want_struct, $comment );
this test assertion deserializes the given YAML string and does a cmp_deeply. deep comparison, the whole tree, no shortcuts π
β is_json
is_json( $json_string, $want_struct, $comment );
this test assertion deserializes the given JSON string and does a cmp_deeply. same energy, JSON edition. obsessed.
π dist_ini
my $ini_text = dist_ini(\%root_config, @plugins);
this routine returns a string that could be used to populate a simple dist.ini file. the %root_config gives data for the "root" section of the configuration. to provide a line multiple times, provide an arrayref. for example, the root section could read:
{
name => 'Dist-Sample',
author => [
'J. Smith <jsmith@example.com>',
'Q. Smith <qsmith@example.com>',
],
}
the root section is optional β skip it if you're not feeling it π
plugins can be given in a few ways:
"PluginMoniker" / "[ "PluginMoniker" ]"
these become [PluginMoniker]
"[ "PluginMoniker", "PluginName" ]"
this becomes [PluginMoniker / PluginName]
"[ "PluginMoniker", { ... } ]" / "[ "PluginMoniker", "PluginName", { ... } ]"
these use the given hashref as the parameters inside the section, with the same semantics as the root section. so whatever rules applied up top? they apply here too, fr fr.
πΈ simple_ini
this behaves exactly like "dist_ini", but it merges any given root config into a starter config, which means that you can often skip any explicit root config. the starter config may change slightly over time, but is something like this:
{
name => 'DZT-Sample',
abstract => 'Sample DZ Dist',
version => '0.001',
author => 'E. Xavier Ample <example@example.org>',
license => 'Perl_5',
copyright_holder => 'E. Xavier Ample',
}
starter config does the heavy lifting so you can just show up and write your plugin. main character energy, honestly π
π AUTHOR π
Ricardo SIGNES π <cpan@semiotic.systems>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2026 by Ricardo SIGNES.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie π«Ά go write some tests, you're gonna eat π
this has been your girl signing off from perl v5.42.3, dated 2026-10-19, telling you to go read Test::DZil(3) and thrive πβ¨
π¦ where this page comes from
- fedora 44: perl-Dist-Zilla 6.040-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms