File Coverage

blib/lib/Test2/EventFacet/Parent.pm
Criterion Covered Total %
statement 16 16 100.0
branch 1 2 50.0
condition 1 2 50.0
subroutine 6 6 100.0
pod 0 1 0.0
total 24 27 88.8


line stmt bran cond sub pod time code
1             package Test2::EventFacet::Parent;
2 246     246   1668 use strict;
  246         505  
  246         7026  
3 246     246   1209 use warnings;
  246         462  
  246         10183  
4              
5             our $VERSION = '1.302181';
6              
7 246     246   1543 use Carp qw/confess/;
  246         588  
  246         16824  
8              
9 246     246   1676 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
  246         11275  
10 246     246   1621 use Test2::Util::HashBase qw{ -hid -children -buffered };
  246         642  
  246         1639  
11              
12             sub init {
13             confess "Attribute 'hid' must be set"
14 6 50   6 0 34 unless defined $_[0]->{+HID};
15              
16 6   50     23 $_[0]->{+CHILDREN} ||= [];
17             }
18              
19             1;
20              
21             __END__
22              
23             =pod
24              
25             =encoding UTF-8
26              
27             =head1 NAME
28              
29             Test2::EventFacet::Parent - Facet for events contains other events
30              
31             =head1 DESCRIPTION
32              
33             This facet is used when an event contains other events, such as a subtest.
34              
35             =head1 FIELDS
36              
37             =over 4
38              
39             =item $string = $parent->{details}
40              
41             =item $string = $parent->details()
42              
43             Human readable description of the event.
44              
45             =item $hid = $parent->{hid}
46              
47             =item $hid = $parent->hid()
48              
49             Hub ID of the hub that is represented in the parent-child relationship.
50              
51             =item $arrayref = $parent->{children}
52              
53             =item $arrayref = $parent->children()
54              
55             Arrayref containing the facet-data hashes of events nested under this one.
56              
57             I<To get the actual events you need to get them from the parent event directly>
58              
59             =item $bool = $parent->{buffered}
60              
61             =item $bool = $parent->buffered()
62              
63             True if the subtest is buffered (meaning the formatter has probably not seen
64             them yet).
65              
66             =back
67              
68             =head1 SOURCE
69              
70             The source code repository for Test2 can be found at
71             F<http://github.com/Test-More/test-more/>.
72              
73             =head1 MAINTAINERS
74              
75             =over 4
76              
77             =item Chad Granum E<lt>exodist@cpan.orgE<gt>
78              
79             =back
80              
81             =head1 AUTHORS
82              
83             =over 4
84              
85             =item Chad Granum E<lt>exodist@cpan.orgE<gt>
86              
87             =back
88              
89             =head1 COPYRIGHT
90              
91             Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>.
92              
93             This program is free software; you can redistribute it and/or
94             modify it under the same terms as Perl itself.
95              
96             See F<http://dev.perl.org/licenses/>
97              
98             =cut