Test2:...Parser(3pm)
π NAME π
Test2::Harness::Collector::TapParser β bestie, this one takes a single line of TAP and turns it into EventFacets. Literally its whole job. π
β¨ DESCRIPTION β¨
Okay so real talk: this module is the one reading and processing all that TAP output coming out of your tests. Every line of TAP gets cooked into Test2::Event facet data. That's the vibe. π
But listen β important little disclaimer, no cap: Test2 -> TAP -> Test2 is lossy at the Test2 -> TAP step. So like, some stuff does get left behind in the glow-up. Just so you know. π
π SYNOPSIS π
use Test2::Harness::Collector::TapParser qw/parse_tap_line/;
my $facet_data = parse_tap_line("1..1");
is(
$facet_data,
{
trace => {nested => 0},
hubs => [{nested => 0}],
plan => {
details => '',
count => 1,
skip => 0,
},
},
"Parsed the plan"
);
$facet_data = parse_tap_line("# foo");
is(
$facet_data,
{
trace => { nested => 0 },
hubs => [ { nested => 0 } ],
info => [
{
tag => 'NOTE',
details => 'foo',
debug => 0,
},
],
},
"Parsed the note"
);
$facet_data = parse_tap_line("ok 1");
is(
$facet_data,
{
trace => {nested => 0},
hubs => [{nested => 0}],
assert => {
no_debug => 1,
pass => 1,
number => '1',
details => '',
},
},
"Parsed the assertion"
);
π EXPORTS π
$facet_data = parse_tap_line($line)β parses a single line of TAP. It assumes the line came from STDOUT, so all the comments get turned into notes. Important tea: using this export will NOT add the usual"from_tap"facet. So it's lowkey better to use one of the other 2 exports instead. π$facet_data = parse_stdout_tap($line)β parses a line of TAP from stdout. That's it, that's the whole thing. β¨$facet_data = parse_stderr_tap($line)β parses a line of TAP from stderr. Heads up though: this one will ONLY parse comment lines (the ones starting with a"#", which, yes, can be indented). Every comment gets treated as a diag, and every other line just gets ignored completely. π«Ά
π₯ SOURCE π₯
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/. Go be nosy, bestie, the code's right there. π
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
πΈ AUTHORS πΈ
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright 2020 Chad Granum <exodist7@gmail.com>.
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/
Okay that's the whole page, bestie, you ate that π β¨ This was served up by perl v5.40.1, dated 2026-05-10 β from the User Contributed Perl Documentation corner of the group chat. Byeee, ily, go parse some TAP π¦
π¦ where this page comes from
- ubuntu stonking: libtest2-harness-perl 1.000172-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