| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #!/usr/bin/perl -w | 
| 2 | 1 |  |  | 1 |  | 109924 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 61 |  | 
| 3 |  |  |  |  |  |  |  | 
| 4 | 1 |  |  | 1 |  | 509 | use Test::More tests => 16; | 
|  | 1 |  |  |  |  | 14232 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 5 | 1 |  |  | 1 |  | 1138 | use Test::Exception; | 
|  | 1 |  |  |  |  | 2841 |  | 
|  | 1 |  |  |  |  | 4 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 1 |  |  | 1 |  | 209 | use File::Basename; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 100 |  | 
| 8 | 1 |  |  | 1 |  | 256 | use File::Spec::Functions; | 
|  | 1 |  |  |  |  | 455 |  | 
|  | 1 |  |  |  |  | 58 |  | 
| 9 | 1 |  |  | 1 |  | 5 | use File::Path; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 54 |  | 
| 10 | 1 |  |  | 1 |  | 348 | use File::Slurp; | 
|  | 1 |  |  |  |  | 11994 |  | 
|  | 1 |  |  |  |  | 50 |  | 
| 11 | 1 |  |  | 1 |  | 300 | use Cache::FileCache; | 
|  | 1 |  |  |  |  | 43866 |  | 
|  | 1 |  |  |  |  | 40 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 1 |  |  | 1 |  | 268 | use lib "../lib"; | 
|  | 1 |  |  |  |  | 541 |  | 
|  | 1 |  |  |  |  | 4 |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 | 1 |  |  | 1 |  | 91772 | use_ok("Devel::PerlySense"); | 
|  | 1 |  |  |  |  | 621 |  | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 6 |  | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 1 | 50 |  | 1 |  | 1755 | BEGIN { -d "t" and chdir("t"); } | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  |  | 
| 23 | 1 |  |  |  |  | 269 | my $dirCache = "data/cache/test"; | 
| 24 | 1 |  |  |  |  | 2 | my $file = "data/cache/random_data_file.txt"; | 
| 25 | 1 |  |  | 1 |  | 22 | END { unlink($file); }; | 
| 26 |  |  |  |  |  |  |  | 
| 27 | 1 |  |  |  |  | 147 | rmtree($dirCache); ok(! -d $dirCache, "Cache dir gone"); | 
|  | 1 |  |  |  |  | 8 |  | 
| 28 | 1 |  |  |  |  | 397 | mkpath($dirCache); ok(  -d $dirCache, "Cache dir created"); | 
|  | 1 |  |  |  |  | 8 |  | 
| 29 | 1 |  |  | 1 |  | 20374 | END { rmtree($dirCache); }; | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  |  | 
| 34 | 1 |  |  |  |  | 189 | my $dirData = "data/project-lib"; | 
| 35 | 1 |  |  |  |  | 2 | my $fileOrigin = "$dirData/Game/Lawn.pm"; | 
| 36 | 1 |  |  |  |  | 2 | my $oLocation; | 
| 37 | 1 |  |  |  |  | 4 | my $rexFile = qr/Game.Location.pm$/; | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  |  | 
| 41 | 1 |  |  |  |  | 16 | print "\nPerlySense objects\n"; | 
| 42 | 1 |  |  |  |  | 4 | ok(my $oPsCache = Devel::PerlySense->new(), "new ok"); | 
| 43 | 1 |  |  |  |  | 194 | ok(my $oCache = Cache::FileCache->new({cache_root => $dirCache}), "Cache::FileCache->new ok"); | 
| 44 | 1 |  |  |  |  | 402 | ok($oPsCache->oCache($oCache), "Set oCache"); | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  |  | 
| 47 | 1 |  |  |  |  | 187 | ok(my $oPsNoCache = Devel::PerlySense->new(), "new ok"); | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  |  | 
| 51 | 1 |  |  |  |  | 186 | print "\nSmart goto\n"; | 
| 52 | 1 |  |  |  |  | 4 | ok(my $oLocationNoCache = $oPsNoCache->oLocationSmartGoTo(file => $fileOrigin, row => 391, col => 53), "NoCache Found source ok, on method"); | 
| 53 | 1 |  |  |  |  | 292 | ok(my $oLocationCache = $oPsCache->oLocationSmartGoTo(file => $fileOrigin, row => 391, col => 53), "Cache Found source ok, on method"); | 
| 54 |  |  |  |  |  |  |  | 
| 55 | 1 |  |  |  |  | 900 | is($oLocationNoCache->file, $oLocationCache->file, " row ok"); | 
| 56 | 1 |  |  |  |  | 442 | is($oLocationNoCache->row, $oLocationCache->row, " row ok"); | 
| 57 | 1 |  |  |  |  | 414 | is($oLocationNoCache->col, $oLocationCache->col, " row ok"); | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  |  | 
| 60 | 1 |  |  |  |  | 654 | print "\nTry again with populated cache\n"; | 
| 61 | 1 |  |  |  |  | 6 | ok($oLocationCache = $oPsCache->oLocationSmartGoTo(file => $fileOrigin, row => 391, col => 53), "Cache Found source ok, on method"); | 
| 62 |  |  |  |  |  |  |  | 
| 63 | 1 |  |  |  |  | 838 | is($oLocationNoCache->file, $oLocationCache->file, " row ok"); | 
| 64 | 1 |  |  |  |  | 477 | is($oLocationNoCache->row, $oLocationCache->row, " row ok"); | 
| 65 | 1 |  |  |  |  | 463 | is($oLocationNoCache->col, $oLocationCache->col, " row ok"); | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | __END__ |