File Coverage

blib/lib/Quote/Code.pm
Criterion Covered Total %
statement 23 25 92.0
branch 2 4 50.0
condition 0 6 0.0
subroutine 7 7 100.0
pod n/a
total 32 42 76.1


line stmt bran cond sub pod time code
1             package Quote::Code;
2              
3 10     10   700558 use v5.14.0;
  10         126  
4 10     10   57 use warnings;
  10         17  
  10         409  
5              
6 10     10   76 use Carp qw(croak);
  10         20  
  10         483  
7              
8 10     10   67 use XSLoader;
  10         18  
  10         503  
9             BEGIN {
10 10     10   37 our $VERSION = '1.0103';
11 10         8149 XSLoader::load;
12             }
13              
14             my %export = (
15             qc => HINTK_QC,
16             qc_to => HINTK_QC_TO,
17             qcw => HINTK_QCW,
18             );
19              
20             sub import {
21 11     11   220 my $class = shift;
22              
23 11         19 my @todo;
24 11         31 for my $item (@_) {
25 0   0     0 push @todo, $export{$item} || croak qq{"$item" is not exported by the $class module};
26             }
27 11 50       59 for my $item (@todo ? @todo : values %export) {
28 33         11757 $^H{$item} = 1;
29             }
30             }
31              
32             sub unimport {
33 1     1   8 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 3         1663 delete $^H{$item};
40             }
41             }
42              
43             'ok'
44              
45             __END__