Test::CPAN::Meta(3)
π¦ Test::CPAN::Meta(3) β the vibe check for your META.yml π¦
okay bestie, so this is a page from the User Contributed Perl Documentation and it's literally all about Test::CPAN::Meta β the module that makes sure your META.yml files are not a mess. pull up a chair, we're doing this π
β¨ NAME β¨
Test::CPAN::Meta β validate your META.yml files. that's it, that's the whole job, and it slays at it π
πΈ SYNOPSIS πΈ
so there are, like, two forms this module can be used in. two vibes. pick your fighter π«Ά
Form one β the standalone test of your distribution's META.yml file:
use Test::More;
eval "use Test::CPAN::Meta";
plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
meta_yaml_ok();
quick note, bestie: you may provide an optional label/comment/message/etc to the function, or one will be created automatically for you. either way works, no stress π
Form two β this one lets you test other META.yml files, or specify a specific version you wanna test against:
use Test::More tests => 6;
use Test::CPAN::Meta;
# specify a file and specification version
meta_spec_ok('META.yml','1.3',$msg);
# specify the specification version to validate the local META.yml
meta_spec_ok(undef,'1.3',$msg);
# specify a file, where the specification version is deduced
# from the file itself
meta_spec_ok('META.yml',undef,$msg);
β οΈ heads up: this form requires you to specify the number of tests you'll be running in your test script. also, plot twist β each meta_spec_ok is actually 2 tests under the hood. math is math π
π DESCRIPTION π
this distribution was written to ensure that a META.yml file β the one provided with a standard distribution uploaded to CPAN β actually meets the specifications that are slowly being introduced to module uploads, via the use of package makers and installers such as ExtUtils::MakeMaker, Module::Build and Module::Install. iconic behavior honestly π
see CPAN::Meta for further details of the CPAN Meta Specification. iykyk π
π₯ FUNCTIONS π₯
meta_yaml_ok([$msg])β the basicMETA.ymlwrapper aroundmeta_spec_ok. returns a hash reference to the contents of the parsedMETA.yml. simple, clean, does what it says π§meta_spec_ok($file, $version [,$msg])β validates the named file against the given specification version. plot twist: both$fileand$versioncan be undefined π. returns a hash reference to the contents of the given file, after it has been parsed. so you get your data back, parsed and ready π
π TESTING META FILES π
there are currently 3 distributions to test META files:
Test-CPAN-Meta
Test-CPAN-Meta-JSON
Test-CPAN-Meta-YAML
all three have slightly different requirements and are intended to be used in slightly different environments. like siblings. same family, different lore πΈ
Test-CPAN-Meta-YAMLrequires a YAML parser, and currently looks for theYAMLorYAML::Syckmodules. this is the original variant of the 3 and was intended to provide a more complete YAML validation of aMETA.yml. the OG, fr fr β¨Test-CPAN-Metarequires theParse::CPAN::Metamodule, which is now part of Perl Core as ofperl-5.10.1. this version is intended to be used by those only wishing to rely on core modules to test theirMETA.ymlfiles. lowkey the minimal-effort icon πTest-CPAN-Meta-JSONis the most recent addition to the family, and is specifically aimed at those distributions that use aMETA.jsonMeta file. the distribution requires theJSONmodule to parse the Meta file. newest sibling, main character energy π
π BUGS, PATCHES & FIXES π
there are no known bugs at the time of this release. slay π
however β if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please send an email to barbie@cpan.org or submit a bug to the RT system (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-CPAN-Meta).
however, it would help greatly if you are able to pinpoint problems or even supply a patch. like, hugely. bestie behavior π«Ά
fixes are dependent upon their severity and my availability. should a fix not be forthcoming, please feel free to (politely) remind me. emphasis on politely, we're not doing that here π
π SEE ALSO π
Test::YAML::Valid
π AUTHOR π
Barbie, <barbie@cpan.org> for Miss Barbell Productions, <http://www.missbarbell.co.uk> π
β COPYRIGHT AND LICENSE β
Copyright (C) 2007-2015 Barbie for Miss Barbell Productions
This distribution is free software; you can redistribute it and/or
modify it under the Artistic Licence v2.
okay and that's the whole page, no cap π tiny sign-off: this beauty is perl v5.42.0, dated 2019-11-30, and it's the Test::CPAN::Meta(3) manpage. go forth and validate those YAMLs, bestie. you're gonna ate π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-CPAN-Meta 0.25-160000.2.2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms