File Coverage

t/PerlySense-Document-Meta-module.t
Criterion Covered Total %
statement 66 66 100.0
branch 1 2 50.0
condition n/a
subroutine 11 11 100.0
pod n/a
total 78 79 98.7


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   102547 use strict;
  1         2  
  1         62  
3              
4 1     1   491 use Test::More tests => 28;
  1         14883  
  1         6  
5 1     1   656 use Test::Exception;
  1         2493  
  1         4  
6              
7 1     1   597 use Data::Dumper;
  1         5214  
  1         42  
8 1     1   4 use File::Basename;
  1         2  
  1         72  
9 1     1   277 use File::Spec::Functions;
  1         451  
  1         58  
10              
11 1     1   265 use lib "../lib";
  1         526  
  1         4  
12              
13 1     1   73231 use_ok("Devel::PerlySense");
  1         667  
  1         3  
  1         2  
  1         10  
14 1     1   322 use_ok("Devel::PerlySense::Document");
  1         81  
  1         2  
  1         1  
  1         9  
15 1     1   196 use_ok("Devel::PerlySense::Document::Meta");
  1         266  
  1         1  
  1         1  
  1         9  
16              
17              
18 1 50   1   1780 BEGIN { -d "t" and chdir("t"); }
19              
20              
21 1         219 ok(my $oDocument = Devel::PerlySense::Document->new(oPerlySense => Devel::PerlySense->new()), "new ok");
22              
23              
24 1         196 my $dirData = "data/project-lib";
25 1         2 my $fileOrigin = "$dirData/Game/Object/Worm.pm";
26              
27 1         10 ok($oDocument->parse(file => $fileOrigin), "Parsed file ok");
28              
29 1         325 my $oMeta = $oDocument->oMeta;
30              
31 1         4 is(scalar(keys %{$oMeta->rhRowColModule}), 18, " found correct number of modules");
  1         23  
32              
33 1         216 is($oMeta->rhRowColModule->{23}->{5}->{oNode} . "", "Data::Dumper", " got module node");
34 1         213 is($oMeta->rhRowColModule->{23}->{5}->{module} . "", "Data::Dumper", " got module");
35 1         210 is($oMeta->rhRowColModule->{24}->{5}->{oNode} . "", "Game::Location", " got module node");
36 1         213 is($oMeta->rhRowColModule->{41}->{5}->{oNode} . "", "Exception::Class", " got module node");
37 1         210 is($oMeta->rhRowColModule->{152}->{24}->{oNode} . "", "Game::Event::Timed", " got module node");
38 1         212 is($oMeta->rhRowColModule->{318}->{13}->{oNode} . "", "ExceptionCouldNotMoveForward", " got module node");
39              
40 1         211 is($oMeta->rhRowColModule->{156}->{17}->{oNode} . "", q{"Carp"}, " got module node, looks somewhat like module, and exists");
41 1         218 is($oMeta->rhRowColModule->{156}->{17}->{module} . "", "Carp", " got module node, looks somewhat like module, and exists");
42 1         212 is($oMeta->rhRowColModule->{157}->{14}->{oNode} . "", q{"File::Spec"}, " got module node, looks like module, good enough");
43 1         211 is($oMeta->rhRowColModule->{157}->{14}->{module} . "", "File::Spec", " got module node, looks like module, good enough");
44 1         213 is($oMeta->rhRowColModule->{171}->{14}->{module} . "", "None::Exsistent::Module", " got module, looks like module, good enough");
45              
46              
47              
48             #print Dumper($oMeta->rhRowColModule->{42});
49              
50 1         214 is($oMeta->rhRowColModule->{341}->{5}, undef, " no module at sub declaration");
51 1         220 is($oMeta->rhRowColModule->{341}->{28}, undef, " no module at variable name");
52 1         219 is($oMeta->rhRowColModule->{341}->{27}, undef, " no module at variable sigil");
53 1         220 is($oMeta->rhRowColModule->{332}->{1}, undef, " no module at nothing");
54 1         216 is($oMeta->rhRowColModule->{363}->{16}, undef, " no module at string literal");
55 1         216 is($oMeta->rhRowColModule->{365}->{5}, undef, " no module at keyword return");
56 1         218 is($oMeta->rhRowColModule->{161}->{47}, undef, " no module at method call");
57 1         221 is($oMeta->rhRowColModule->{145}->{29}, undef, " no module at numeric literal");
58              
59              
60 1         229 is($oMeta->rhRowColModule->{42}->{5}, undef, " no module at string literal 'Exception'");
61 1         220 is($oMeta->rhRowColModule->{159}->{16}, undef, ' no module at string literal "O"');
62 1         277 is($oMeta->rhRowColModule->{151}->{18}, undef, ' no module at string literal "white"');
63              
64             __END__