Test2::...Coverage(3)
π Test2::EventFacet::Coverage π
okay bestie, so this is a page from the User Contributed Perl Documentation set (the perl man pages, yk), and it's all about one lil' facet in the Test2 universe. buckle up, it's coverage time π
β¨ NAME β¨
Test2::EventFacet::Coverage β it's giving... file coverage information. literally that. that's the whole gig. π
π¦ DESCRIPTION π¦
so basically this facet is carrying around a whole list of the files that got covered by your test run. like, "here's everything we touched, bestie, here's the receipts" πβ¨
πΈ FIELDS πΈ
these are the lil' accessor things you can pull out of it. each one comes in two flavors β the hash-style {...} and the method-call style β and they give you the exact same thing, so pick your fighter π«Ά
$string = $about->{details}$string = $about->details()
this one's just a lil' summary of the files that ran. a vibe check on your coverage, if you will. π
$arrayref = $about->{files}$arrayref = $about->files()
an arrayref of every file that got touched during testing. and like, everything β this includes modules that were loaded, modules that had subroutines called, and also files that got opened via open(). no file left behind fr fr. π
$hashref = $about->{submap}$hashref = $about->submap()
this is the subroutine map, and it looks a lil' something like this:
{
'SomeModule.pm' => {
# The wildcard is used when a proper sub name cannot be determined
'*' => { ... },
'subroutine' => [
'*', # The wildcard is used when no 'called by' can be determined
$FROM_A,
$FROM_B,
...
],
},
...
}
so yeah β per module, you get sub names, and for each sub you get who called it. and when the name isn't knowable? wildcard. iconic behaviour honestly β
$hashref = $about->{openmap}$hashref = $about->openmap()
the open map. same energy, different list:
{
# The items in this list can be anything, strings, numbers,
# data structures, etc.
# A naive attempt is made to avoid duplicates in this list,
# so the same string or reference will not appear twice, but 2
# different references with identical contents may appear.
"some_file.ext" => [
'*', # The wildcard is used when no 'called by' can be determined
$FROM_A,
$FROM_b,
],
}
okay so real talk about this one: the items in that list can be literally anything β strings, numbers, data structures, whatever. and there's a naive attempt to dodge duplicates, so the same string or the same reference won't show up twice, but two different references with identical contents absolutely can. so don't come for it, it's trying its best ππ
π₯ SOURCE π₯
the source code repo for Test2-Plugin-Cover lives right here:
https://github.com/Test-More/Test2-Plugin-Cover
go look, it's free β¨
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
π AUTHORS π
- Chad Granum
<exodist@cpan.org>
π COPYRIGHT π
Copyright 2020 Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
and that's the whole page bestie, we ate and left no crumbs π«Ά
mwah, this was perl v5.42.3, dated 2026-09-09, and it's part of the User Contributed Perl Documentation. slay, bye π
β¨
π¦ where this page comes from
- fedora 43: perl-Test2-Plugin-Cover 0.0.29-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Test2-Plugin-Cover 0.0.29-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