File Coverage

blib/lib/Quote/Ref.pm
Criterion Covered Total %
statement 24 26 92.3
branch 2 4 50.0
condition 0 6 0.0
subroutine 7 7 100.0
pod n/a
total 33 43 76.7


line stmt bran cond sub pod time code
1             package Quote::Ref;
2              
3 4     4   105210 use v5.12.0;
  4         16  
  4         197  
4              
5 4     4   21 use warnings;
  4         9  
  4         150  
6              
7 4     4   22 use Carp qw(croak);
  4         14  
  4         380  
8              
9 4     4   29 use XSLoader;
  4         7  
  4         220  
10             BEGIN {
11 4     4   8 our $VERSION = '0.03';
12 4         3927 XSLoader::load __PACKAGE__, $VERSION;
13             }
14              
15             my %export = (
16             qwa => HINTK_QWA,
17             qwh => HINTK_QWH,
18             );
19              
20             sub import {
21 5     5   96 my $class = shift;
22              
23 5         7 my @todo;
24 5         14 for my $item (@_) {
25 0   0     0 push @todo, $export{$item} || croak qq{"$item" is not exported by the $class module};
26             }
27 5 50       24 for my $item (@todo ? @todo : values %export) {
28 10         13155 $^H{$item} = 1;
29             }
30             }
31              
32             sub unimport {
33 1     1   7 my $class = shift;
34 1         1 my @todo;
35 1         3 for my $item (@_) {
36 0   0     0 push @todo, $export{$item} || croak qq{"$item" is not exported by the $class module};
37             }
38 1 50       4 for my $item (@todo ? @todo : values %export) {
39 2         1822 delete $^H{$item};
40             }
41             }
42              
43             'ok'
44              
45             __END__