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   724718 use v5.14.0;
  10         122  
4 10     10   54 use warnings;
  10         18  
  10         427  
5              
6 10     10   58 use Carp qw(croak);
  10         17  
  10         484  
7              
8 10     10   73 use XSLoader;
  10         20  
  10         501  
9             BEGIN {
10 10     10   34 our $VERSION = '1.0104';
11 10         8985 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   162 my $class = shift;
22              
23 11         32 my @todo;
24 11         29 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       58 for my $item (@todo ? @todo : values %export) {
28 33         12386 $^H{$item} = 1;
29             }
30             }
31              
32             sub unimport {
33 1     1   7 my $class = shift;
34 1         2 my @todo;
35 1         2 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         1331 delete $^H{$item};
40             }
41             }
42              
43             'ok'
44              
45             __END__