File Coverage

blib/lib/Sub/Alias.pm
Criterion Covered Total %
statement 136 223 60.9
branch 6 14 42.8
condition 6 14 42.8
subroutine 18 19 94.7
pod n/a
total 166 270 61.4


line stmt bran cond sub pod time code
1             package Sub::Alias;
2 6     6   335832 use 5.012;
  6         60  
3 6     6   27 use strict;
  6         10  
  6         114  
4 6     6   22 use warnings;
  6         10  
  6         278  
5              
6             our $VERSION = '1.0.0';
7              
8 6     6   5056 use Keyword::Declare;
  6         695735  
  6         100  
9              
10 7     7   287 sub import {
  0            
11 0 50 50 3   0 keyword alias (Ident $new_ident, Comma, Str $old_name) {
  0         0  
  0         0  
  7         179  
  3         654646  
  3         8  
  3         10  
12 0         0 my $old_ident = substr($old_name, 1, -1);
  7         39  
  3         160  
13 0         0 return qq! {; no strict "refs"; *{"${new_ident}"} = *{"${old_ident}"}; }; !;
  3         47  
14             };
15 0         0  
  0         0  
  0         0  
  3         66  
  3         65  
  3         12  
  7         153  
16 0 50 50 6   0 keyword alias (Str $new_name, Comma, Str $old_name) {
  0         0  
  0         0  
  0         0  
  3         32  
  7         89  
  6         1308959  
  6         14  
  6         18  
17 0         0 my $new_ident = substr($new_name, 1, -1);
  0         0  
  3         26  
  7         27  
  6         498  
18 0         0 my $old_ident = substr($old_name, 1, -1);
  6         88  
19 0         0 return qq! {; no strict "refs"; *{"${new_ident}"} = *{"${old_ident}"}; }; !;
  3         37  
20 0         0 };
  0         0  
  0         0  
  0         0  
  3         12  
  6         107  
  6         32  
  6         22  
21 0         0  
  0         0  
  3         45  
  6         118  
  7         134  
22 6 50 50 1   85 keyword alias (Ident $new_ident, Comma, /\\&(?&PerlIdentifier)/ $sub_ref) {
  0         0  
  0         0  
  0         0  
  0         0  
  7         66  
  6         47  
  7         66  
  1         226320  
  1         2  
  1         3  
23 0         0 my $old_ident = substr($sub_ref, 2);
  7         325  
  7         27  
  1         3  
24 6     6   214580 return qq! {; no strict "refs"; *{"${new_ident}"} = *{"${old_ident}"}; }; !;
  0         0  
  0         0  
  6         66  
  1         20  
25 0         0 };
  6         22  
26 0         0  
  0         0  
  0         0  
  0         0  
  6         17  
  1         32  
  1         13  
  1         7  
  7         128  
27 0 50 50 3   0 keyword alias (Str $new_name, Comma, /\\&(?&PerlIdentifier)/ $sub_ref) {
  0         0  
  0         0  
  0         0  
  0         0  
  6         34  
  1         3  
  7         67  
  3         651095  
  3         8  
  3         7  
28 6         46 my $new_ident = substr($new_name, 1, -1);
  0         0  
  0         0  
  7         42  
  1         13  
  7         25  
  3         7  
29 0         0 my $old_ident = substr($sub_ref, 2);
  7         211  
  3         51  
30 6     6   216980 my $caller = caller(2);
  0         0  
  1         18  
31 0         0 return qq! {; no strict "refs"; *{"${new_ident}"} = *{"${old_ident}"}; }; !;
  0         0  
  0         0  
  0         0  
  1         30  
  3         91  
  3         6  
  3         5  
32 0         0 };
  0         0  
  1         8  
  3         5  
33 6         46  
  0         0  
  7         50  
  3         34  
  7         173  
34 0 50 50 3   0 keyword alias (VariableScalar $new_name, Comma, Str $old_name) {
  0         0  
  0         0  
  7         196  
  7         72  
  3         611417  
  3         9  
  3         10  
35 6     6   211743 my $old_ident = substr($old_name, 1, -1);
  0         0  
  0         0  
  3         47  
  7         26  
  3         8  
36 0         0 return qq! {; no strict "refs"; *{"${new_name}"} = *{"${old_ident}"}; }; !;
  0         0  
  3         21  
  3         53  
37 0         0 };
  3         17  
38 0         0  
  0         0  
  0         0  
  0         0  
  3         17  
  3         91  
  3         6  
  3         7  
  7         127  
39 0 50 50 1   0 keyword alias (VariableScalar $new_name, Comma, /\\&(?&PerlIdentifier)/ $sub_ref) {
  0         0  
  0         0  
  0         0  
  0         0  
  3         21  
  3         196  
  7         63  
  1         203050  
  1         3  
  1         3  
40 6         46 my $old_ident = substr($sub_ref, 2);
  0         0  
  0         0  
  7         43  
  3         32  
  7         28  
  1         2  
41 0         0 return qq! {; no strict "refs"; *{"${new_name}"} = *{"${old_ident}"}; }; !;
  7         193  
  1         18  
42 6     6   219154 };
  0         0  
  3         40  
43 0         0 }
  0         0  
  0         0  
  0         0  
  3         11  
  1         31  
  1         69  
  1         8  
44 0         0  
  0         0  
  3         20  
  1         2  
45 6     0   43 sub unimport {
  0         0  
  7         45  
  1         15  
  0            
  0            
46 7 0 0     194 unkeyword alias;
  0            
  0            
47 6     6   212031 }
  0         0  
  1         20  
  0            
48 0     6   0  
  6         182508  
  1         32  
49 0         0 1;
  6         1040  
  1         8  
50 6         45  
  7         40  
51 7         188 __END__