line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
18
|
|
|
18
|
|
258
|
use v5.14; |
|
18
|
|
|
|
|
66
|
|
2
|
18
|
|
|
18
|
|
107
|
use warnings; |
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
767
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::BDD::Cucumber::Model::Document 0.86; |
5
|
|
|
|
|
|
|
|
6
|
18
|
|
|
18
|
|
120
|
use Moo; |
|
18
|
|
|
|
|
51
|
|
|
18
|
|
|
|
|
133
|
|
7
|
18
|
|
|
18
|
|
6406
|
use Types::Standard qw( Str ArrayRef InstanceOf ); |
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
141
|
|
8
|
18
|
|
|
18
|
|
22342
|
use Test::BDD::Cucumber::Model::Line; |
|
18
|
|
|
|
|
57
|
|
|
18
|
|
|
|
|
3963
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Test::BDD::Cucumber::Model::Document - Model to represent a feature file on disk or in memory |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
version 0.86 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Model to represent a feature file on disk or in memory |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 filename |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
The filename from which the document was loaded. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has 'filename' => ( is => 'ro', isa => Str ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 content |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
The file contents, as a string |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has 'content' => ( is => 'ro', isa => Str ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 lines |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
The file contents, as an arrayref of L |
43
|
|
|
|
|
|
|
objects |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has 'lines' => ( |
48
|
|
|
|
|
|
|
is => 'rw', |
49
|
|
|
|
|
|
|
default => sub { [] }, |
50
|
|
|
|
|
|
|
isa => ArrayRef[InstanceOf['Test::BDD::Cucumber::Model::Line']] |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 OTHER |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 BUILD |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
The instantiation populates C by splitting the input on newlines. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Create lines |
62
|
|
|
|
|
|
|
sub BUILD { |
63
|
52
|
|
|
52
|
1
|
1764
|
my $self = shift; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# Reset any content that was in lines |
66
|
52
|
|
|
|
|
170
|
my $counter = 0; |
67
|
|
|
|
|
|
|
|
68
|
52
|
|
|
|
|
943
|
for my $line ( split( /\n/, $self->content ) ) { |
69
|
1299
|
|
|
|
|
28026
|
my $obj = Test::BDD::Cucumber::Model::Line->new( |
70
|
|
|
|
|
|
|
{ |
71
|
|
|
|
|
|
|
number => ++$counter, |
72
|
|
|
|
|
|
|
document => $self, |
73
|
|
|
|
|
|
|
raw_content => $line |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
); |
76
|
1299
|
|
|
|
|
126437
|
push( @{ $self->lines }, $obj ); |
|
1299
|
|
|
|
|
22941
|
|
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Peter Sergeant C |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 LICENSE |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Copyright 2019-2023, Erik Huelsmann |
87
|
|
|
|
|
|
|
Copyright 2011-2019, Peter Sergeant; Licensed under the same terms as Perl |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; |