Test2::Harness::Collector::TapParser(3pm) | User Contributed Perl Documentation | Test2::Harness::Collector::TapParser(3pm) |
Test2::Harness::Collector::TapParser - Produce EventFacets from a line of TAP.
This module is responsible for reading and processing any TAP output from tests. Lines of TAP output are processed into Test2::Event facet data. Note that "Test2 -> TAP -> Test2" is lossy at the "Test2 -> TAP" step.
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" );
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
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/
2023-03-12 | perl v5.36.0 |