| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #!/usr/bin/perl -w | 
| 2 | 1 |  |  | 1 |  | 116698 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 62 |  | 
| 3 |  |  |  |  |  |  |  | 
| 4 | 1 |  |  | 1 |  | 488 | use Test::More tests => 23; | 
|  | 1 |  |  |  |  | 14336 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 5 | 1 |  |  | 1 |  | 616 | use Test::Exception; | 
|  | 1 |  |  |  |  | 2499 |  | 
|  | 1 |  |  |  |  | 4 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 1 |  |  | 1 |  | 613 | use Data::Dumper; | 
|  | 1 |  |  |  |  | 5524 |  | 
|  | 1 |  |  |  |  | 67 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 1 |  |  | 1 |  | 356 | use lib "lib"; | 
|  | 1 |  |  |  |  | 537 |  | 
|  | 1 |  |  |  |  | 5 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 1 |  |  | 1 |  | 75845 | use_ok("Devel::PerlySense::Document::Api"); | 
|  | 1 |  |  |  |  | 460 |  | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 12 | 1 |  |  | 1 |  | 296 | use_ok("Devel::PerlySense::Document::Api::Method"); | 
|  | 1 |  |  |  |  | 22019 |  | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 9 |  | 
| 13 | 1 |  |  | 1 |  | 1354 | use_ok("Devel::PerlySense"); | 
|  | 1 |  |  |  |  | 122 |  | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 8 |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 | 1 |  |  |  |  | 409 | my $dirData = "t/data/overview/api/lib"; | 
| 17 | 1 |  |  |  |  | 3 | my $fileOrigin = "$dirData/Game/Object/Worm.pm"; | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 1 |  |  |  |  | 348 | print "\n* Class\n"; | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 1 |  |  |  |  | 7 | ok(my $oDocument = Devel::PerlySense::Document->new(oPerlySense => Devel::PerlySense->new()), "new ok"); | 
| 23 | 1 |  |  |  |  | 396 | ok($oDocument->parse(file => $fileOrigin), "Parsed file ok"); | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  |  | 
| 26 | 1 |  |  |  |  | 304 | my $oMethod; | 
| 27 | 1 |  |  |  |  | 3 | my $method = "undeclaredMethod"; | 
| 28 |  |  |  |  |  |  |  | 
| 29 | 1 |  |  |  |  | 11 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 30 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 31 |  |  |  |  |  |  | name => $method, | 
| 32 |  |  |  |  |  |  | ), "new with missing method ok"); | 
| 33 | 1 |  |  |  |  | 317 | is($oMethod->name, $method, "  name set ok"); | 
| 34 | 1 |  |  |  |  | 218 | is($oMethod->oLocationDocumented, undef, "  oLocationDocumented unknown ok"); | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  |  | 
| 38 | 1 |  |  |  |  | 195 | $method = "isRealPlayer"; | 
| 39 | 1 |  |  |  |  | 9 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 40 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 41 |  |  |  |  |  |  | name => $method, | 
| 42 |  |  |  |  |  |  | ), "new with existing method ok"); | 
| 43 | 1 |  |  |  |  | 228 | is($oMethod->name, $method, "  name set ok"); | 
| 44 | 1 |  |  |  |  | 212 | isnt($oMethod->oLocationDocumented, undef, "  oLocationDocumented set ok"); | 
| 45 | 1 |  |  |  |  | 226 | is($oMethod->oLocationDocumented->row, 69, "  oLocationDocumented row correct"); | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  |  | 
| 51 | 1 |  |  |  |  | 189 | note("Rendering of method signature"); | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  |  | 
| 54 | 1 |  |  |  |  | 44 | $method = "isRealPlayer"; | 
| 55 | 1 |  |  |  |  | 7 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 56 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 57 |  |  |  |  |  |  | name => $method, | 
| 58 |  |  |  |  |  |  | ), "Found method ($method)"); | 
| 59 | 1 |  |  |  |  | 206 | is($oMethod->signature, "isRealPlayer", "  Bareword method name"); | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  |  | 
| 62 | 1 |  |  |  |  | 188 | $method = "oDirection"; | 
| 63 | 1 |  |  |  |  | 6 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 64 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 65 |  |  |  |  |  |  | name => $method, | 
| 66 |  |  |  |  |  |  | ), "Found method ($method)"); | 
| 67 | 1 |  |  |  |  | 210 | is($oMethod->signature, 'oDirection($direction)', "  Method name and  params"); | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  |  | 
| 71 | 1 |  |  |  |  | 191 | $method = "oEventMove"; | 
| 72 | 1 |  |  |  |  | 8 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 73 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 74 |  |  |  |  |  |  | name => $method, | 
| 75 |  |  |  |  |  |  | ), "Found method ($method)"); | 
| 76 | 1 |  |  |  |  | 232 | is($oMethod->signature, 'oEventMove', '  Method name with prefix $self-> or whatever'); | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  |  | 
| 80 | 1 |  |  |  |  | 190 | $method = "score"; | 
| 81 | 1 |  |  |  |  | 6 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 82 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 83 |  |  |  |  |  |  | name => $method, | 
| 84 |  |  |  |  |  |  | ), "Found method ($method)"); | 
| 85 | 1 |  |  |  |  | 217 | is($oMethod->signature, 'score( ... args ... )', '  Method name with tailing ;'); | 
| 86 |  |  |  |  |  |  |  | 
| 87 |  |  |  |  |  |  |  | 
| 88 |  |  |  |  |  |  |  | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  |  | 
| 91 | 1 |  |  |  |  | 187 | note("Rendering of calling method signature"); | 
| 92 |  |  |  |  |  |  |  | 
| 93 | 1 |  |  |  |  | 45 | $method = "score"; | 
| 94 | 1 |  |  |  |  | 9 | my $oLocation = Devel::PerlySense::Document::Location->new(); | 
| 95 | 1 |  |  |  |  | 24 | $oLocation->file($fileOrigin); | 
| 96 | 1 |  |  |  |  | 11 | ok($oMethod = Devel::PerlySense::Document::Api::Method->new( | 
| 97 |  |  |  |  |  |  | oDocument => $oDocument, | 
| 98 |  |  |  |  |  |  | name => $method, | 
| 99 |  |  |  |  |  |  | ), "Found method ($method)"); | 
| 100 | 1 |  |  |  |  | 320 | is($oMethod->signatureCall($oLocation), '->score( ... args ... )', '  Call signature for method in current class'); | 
| 101 |  |  |  |  |  |  |  | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  |  | 
| 104 |  |  |  |  |  |  |  | 
| 105 | 1 |  |  |  |  | 215 | $oLocation->file("$fileOrigin.another-file"); | 
| 106 | 1 |  |  |  |  | 8 | is($oMethod->signatureCall($oLocation), '\>score( ... args ... )', '  Call signature for method in other class'); | 
| 107 |  |  |  |  |  |  |  | 
| 108 |  |  |  |  |  |  |  | 
| 109 |  |  |  |  |  |  |  | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  |  | 
| 112 |  |  |  |  |  |  |  | 
| 113 |  |  |  |  |  |  | __END__ |