File Coverage

t/PerlySense-Plugin-Syntax-Moose-has.t
Criterion Covered Total %
statement 40 40 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 48 48 100.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   121343 use strict;
  1         2  
  1         64  
3              
4 1     1   501 use Test::More tests => 6;
  1         19257  
  1         8  
5 1     1   1465 use Test::Differences;
  1         12700  
  1         60  
6              
7 1     1   472 use Data::Dumper;
  1         5201  
  1         64  
8              
9 1     1   340 use lib "../lib";
  1         547  
  1         4  
10              
11 1     1   83998 use_ok("Devel::PerlySense");
  1         871  
  1         1406233  
  1         2  
  1         6  
12 1     1   269 use_ok("Devel::PerlySense::Document::Meta");
  1         76  
  1         1  
  1         1  
  1         7  
13 1     1   192 use_ok("Devel::PerlySense::Document::Location");
  1         55  
  1         194  
  1         1  
  1         11  
14              
15             #use Carp::Always;
16              
17 1         190 my $dirData = "t/data/plugin-moose";
18 1         1 my $oMeta;
19              
20              
21 1         1 my $file = "Has.pm";
22 1         5 note("Checking has in ($file)");
23              
24 1         45 my $fileOrigin = "t/data/plugin-moose/$file";
25 1         4 ok(
26             my $oDocument = Devel::PerlySense::Document->new(oPerlySense => Devel::PerlySense->new()),
27             "new ok",
28             );
29              
30 1         399 ok($oDocument->parse(file => $fileOrigin), "Parsed file ok");
31              
32              
33 1         354507 $oMeta = $oDocument->oMeta;
34             # eq_or_diff
35 1         25 is_deeply(
36 1         4 [ @{$oMeta->raLocationSub} ],
37             [
38             Devel::PerlySense::Document::Location->new(
39             file => $fileOrigin,
40             row => 12,
41             col => 1,
42             rhProperty => {
43             nameSub => "timeBareword",
44             source => q|has timeBareword => (is => "rw");|,
45             namePackage => "Has",
46             oLocationEnd => Devel::PerlySense::Document::Location->new(
47             file => $fileOrigin,
48             row => 12,
49             col => 33,
50             ),
51             },
52             ),
53              
54             Devel::PerlySense::Document::Location->new(
55             file => $fileOrigin,
56             row => 14,
57             col => 1,
58             rhProperty => {
59             nameSub => "timeQuoted",
60             source => q|has "timeQuoted" => (
61             is => "rw",
62             isa => "Int",
63             );|,
64             namePackage => "Has",
65             oLocationEnd => Devel::PerlySense::Document::Location->new(
66             file => $fileOrigin,
67             row => 17,
68             col => 3,
69             ),
70             },
71             ),
72              
73             Devel::PerlySense::Document::Location->new(
74             file => $fileOrigin,
75             row => 19,
76             col => 1,
77             rhProperty => {
78             nameSub => "timeQuotedComma",
79             source => q|has "timeQuotedComma", (is => "rw");|,
80             namePackage => "Has",
81             oLocationEnd => Devel::PerlySense::Document::Location->new(
82             file => $fileOrigin,
83             row => 19,
84             col => 36,
85             ),
86             },
87             ),
88              
89             #Quoted list
90             Devel::PerlySense::Document::Location->new(
91             file => $fileOrigin,
92             row => 23,
93             col => 1,
94             rhProperty => {
95             nameSub => "timeList1",
96             source => q|has ["timeList1", "timeList2"] => (
97             is => "rw",
98             );|,
99             namePackage => "Has",
100             oLocationEnd => Devel::PerlySense::Document::Location->new(
101             file => $fileOrigin,
102             row => 25,
103             col => 3,
104             ),
105             },
106             ),
107             Devel::PerlySense::Document::Location->new(
108             file => $fileOrigin,
109             row => 23,
110             col => 1,
111             rhProperty => {
112             nameSub => "timeList2",
113             source => q|has ["timeList1", "timeList2"] => (
114             is => "rw",
115             );|,
116             namePackage => "Has",
117             oLocationEnd => Devel::PerlySense::Document::Location->new(
118             file => $fileOrigin,
119             row => 25,
120             col => 3,
121             ),
122             },
123             ),
124              
125             #Quoted Word list
126             Devel::PerlySense::Document::Location->new(
127             file => $fileOrigin,
128             row => 27,
129             col => 1,
130             rhProperty => {
131             nameSub => "timeQwList1",
132             source => q|has [ qw/ timeQwList1 timeQwList2 / ] => (
133             is => "ro",
134             );|,
135             namePackage => "Has",
136             oLocationEnd => Devel::PerlySense::Document::Location->new(
137             file => $fileOrigin,
138             row => 29,
139             col => 3,
140             ),
141             },
142             ),
143             Devel::PerlySense::Document::Location->new(
144             file => $fileOrigin,
145             row => 27,
146             col => 1,
147             rhProperty => {
148             nameSub => "timeQwList2",
149             source => q|has [ qw/ timeQwList1 timeQwList2 / ] => (
150             is => "ro",
151             );|,
152             namePackage => "Has",
153             oLocationEnd => Devel::PerlySense::Document::Location->new(
154             file => $fileOrigin,
155             row => 29,
156             col => 3,
157             ),
158             },
159             ),
160              
161             #Quoted Word list with "qw" as one of the words
162             Devel::PerlySense::Document::Location->new(
163             file => $fileOrigin,
164             row => 31,
165             col => 1,
166             rhProperty => {
167             nameSub => "qw",
168             source => q|has [ qw/ qw timeQwList3 / ] => (
169             is => "ro",
170             );|,
171             namePackage => "Has",
172             oLocationEnd => Devel::PerlySense::Document::Location->new(
173             file => $fileOrigin,
174             row => 33,
175             col => 3,
176             ),
177             },
178             ),
179             Devel::PerlySense::Document::Location->new(
180             file => $fileOrigin,
181             row => 31,
182             col => 1,
183             rhProperty => {
184             nameSub => "timeQwList3",
185             source => q|has [ qw/ qw timeQwList3 / ] => (
186             is => "ro",
187             );|,
188             namePackage => "Has",
189             oLocationEnd => Devel::PerlySense::Document::Location->new(
190             file => $fileOrigin,
191             row => 33,
192             col => 3,
193             ),
194             },
195             ),
196              
197             #q/name/
198             Devel::PerlySense::Document::Location->new(
199             file => $fileOrigin,
200             row => 35,
201             col => 1,
202             rhProperty => {
203             nameSub => "timeSingleQuoted",
204             source => q|has q/timeSingleQuoted/ => ();|,
205             namePackage => "Has",
206             oLocationEnd => Devel::PerlySense::Document::Location->new(
207             file => $fileOrigin,
208             row => 35,
209             col => 30,
210             ),
211             },
212             ),
213              
214             #"+name"
215             Devel::PerlySense::Document::Location->new(
216             file => $fileOrigin,
217             row => 39,
218             col => 1,
219             rhProperty => {
220             nameSub => "timePlus",
221             source => q|has "+timePlus" => (is => "rw");|,
222             namePackage => "Has",
223             oLocationEnd => Devel::PerlySense::Document::Location->new(
224             file => $fileOrigin,
225             row => 39,
226             col => 32,
227             ),
228             },
229             ),
230            
231             ],
232             " correct sub declarations",
233             );
234              
235              
236              
237              
238             __END__