File Coverage

t/PerlySense-Document-empty.t
Criterion Covered Total %
statement 47 47 100.0
branch 1 2 50.0
condition n/a
subroutine 9 9 100.0
pod n/a
total 57 58 98.2


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   186174 use strict;
  1         2  
  1         63  
3              
4 1     1   500 use Test::More tests => 17;
  1         17851  
  1         8  
5 1     1   619 use Test::Exception;
  1         3778  
  1         5  
6              
7 1     1   254 use File::Basename;
  1         1  
  1         109  
8 1     1   329 use File::Spec::Functions;
  1         7188  
  1         143  
9              
10 1     1   729 use lib "../lib";
  1         607  
  1         4  
11              
12 1     1   96621 use_ok("Devel::PerlySense::Document");
  1         437  
  1         3  
  1         2  
  1         12  
13 1     1   1863 use_ok("Devel::PerlySense::Document::Location");
  1         143  
  1         2  
  1         2  
  1         11  
14              
15              
16 1 50   1   2035 BEGIN { -d "t" and chdir("t"); }
17              
18              
19 1         629 ok(my $oDocument = Devel::PerlySense::Document->new(oPerlySense => Devel::PerlySense->new()), "new ok");
20              
21 1         231 my $dirData = "data/simple-lib";
22 1         3 my $fileOrigin = "$dirData/lib/Win32/Word/Writer.pm";
23              
24 1         5 ok($oDocument->parse(file => $fileOrigin), "Parsed file ok");
25              
26              
27              
28              
29 1         300 is(scalar($oDocument->isEmptyAt(row => 452, col => 1)), 1, "No perl fragment ok, between stuff");
30 1         199 is($oDocument->isEmptyAt(row => 154, col => 10), 0, "On use module");
31 1         192 is($oDocument->isEmptyAt(row => 160, col => 25), 0, "On class method call ");
32 1         189 is($oDocument->isEmptyAt(row => 193, col => 14), 0, "On use with params");
33 1         201 is($oDocument->isEmptyAt(row => 157, col => 11), 0, "On use");
34              
35 1         198 is(scalar($oDocument->isEmptyAt(row => 287, col => 18)), 0, "Some perl fragment ok, on object->method");
36              
37              
38 1         210 is(scalar($oDocument->isEmptyAt(row => 288, col => 2)), 1, "Nothing at left margin");
39 1         399 is(scalar($oDocument->isEmptyAt(row => 286, col => 20)), 1, "Nothing at right of statement");
40 1         189 is(scalar($oDocument->isEmptyAt(row => 298, col => 1)), 1, "Nothing between statements");
41 1         191 is(scalar($oDocument->isEmptyAt(row => 288, col => 23)), 1, "Nothing in small whitespace");
42              
43              
44 1         203 print "\nTesting things that may change in the future when they become parsed for\n";
45 1         5 is(scalar($oDocument->isEmptyAt(row => 290, col => 25)), 1, "Some perl fragment ok, on variable");
46 1         194 is(scalar($oDocument->isEmptyAt(row => 290, col => 31)), 1, "Some perl fragment ok, on semicolon");
47 1         193 is(scalar($oDocument->isEmptyAt(row => 295, col => 1)), 1, "Some perl fragment ok, on {");
48              
49              
50              
51              
52              
53              
54             __END__