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>


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