blib/lib/Acme/MetaSyntactic/unicode.pm

filter: Statementstmt 92.8% 26 / 28 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 78.0% 32 / 41 CC 1 SCAR 0.0
CC
1
Cov
81%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Acme/MetaSyntactic/icao.pm ↑ Summary blib/lib/Acme/MetaSyntactic/pause_id.pm »
1 package Acme::MetaSyntactic::unicode;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use Acme::MetaSyntactic::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 our @ISA = qw( Acme::MetaSyntactic::List );
5 2 our $VERSION = '1.001';
6  
7 {
8 # a very basic list
9 2 my $data = join "\n",
10 2 map { ( "\t\tLATIN CAPITAL LETTER $_", "\t\tLATIN SMALL LETTER $_" ) }
11 'A' .. 'Z';
12  
13 # try to find better
14 2 ▶ if ( $] >= 5.006 && $] < 5.007003 ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($] >= 5.006 and $] < 5.007003) { } 0 2 2
elsif ($] >= 5.007003) { } 2 0 2
Condition33%1/3
$] >= "5.006" and $] < "5.007003"
!ll&&!rl&&r
020
MC/DC0%0/2
$] >= "5.006" and $] < "5.007003"
$] >= "5.006" $] < "5.007003"
Truth table33%1/3
A and B
A= $] >= "5.006"B= $] < "5.007003"
ABresult
0X0
100
111
15 0 eval { $data = require 'unicode/Name.pl'; };
16 }
17 elsif ( $] >= 5.007003 ) {
18 2 eval { $data = require 'unicore/Name.pl'; };
19  
20 # since v5.11.3, unicore/Name.pl creates subroutines
21 # they end up in our namespace, so get rid of them
22 2 undef *code_point_to_name_special;
23 2 undef *name_to_code_point_special;
24 }
25  
26 # clean up the list
27 2 my %seen;
28 $data = join ' ',
29 grep !$seen{$_}++, # we might have aliases/duplicates
30 213238 map { s/ \(.*\)//; y/- /_/; $_ }
31 213238 grep { $_ ne '<control>' } # what's this for a character name?
32 2 ▶ map { my @F = split /\t+/; @F > 2 ? () : $F[1] } # remove blocks
Branch: 1 branch
BranchTrueFalseTotal
@F > 2 ? : 0 213238 213238
33 split /\n/, $data;
34  
35 2 __PACKAGE__->init( { names => $data } );
36 }
37  
38 2 1;
39  
40 __END__
« blib/lib/Acme/MetaSyntactic/icao.pm ↑ Summary blib/lib/Acme/MetaSyntactic/pause_id.pm »