File Coverage

blib/lib/NewsExtractor/Types.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 23 100.0


line stmt bran cond sub pod time code
1             package NewsExtractor::Types;
2 3     3   2074 use v5.18;
  3         36  
3              
4 3     3   638 use Importer 'NewsExtractor::Constants' => 'NEWSPAPER_NAMES';
  3         7602  
  3         23  
5 3     3   178 use Importer Encode => 'is_utf8';
  3         7  
  3         18  
6              
7 3     3   1184 use Type::Library -base;
  3         62802  
  3         42  
8 3     3   2428 use Type::Utils -all;
  3         10712  
  3         43  
9             extends "Types::Standard";
10              
11             declare Text => as "Str", where {
12 1     1   3618 ($_ eq '') || ( is_utf8($_) && ($_ !~ m/[^\P{PosixCntrl}\n]/) )
  1         3  
  1         17  
13             };
14              
15             declare Text1K => as "Text", where { length($_) <= 1024 };
16             declare Text4K => as "Text", where { length($_) <= 4096 };
17              
18             enum NewspaperName => NEWSPAPER_NAMES;
19              
20             1;