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   1817 use v5.18;
  3         34  
3              
4 3     3   639 use Importer 'NewsExtractor::Constants' => 'NEWSPAPER_NAMES';
  3         7367  
  3         21  
5 3     3   107 use Importer Encode => 'is_utf8';
  3         5  
  3         71  
6              
7 3     3   1145 use Type::Library -base;
  3         58716  
  3         33  
8 3     3   2092 use Type::Utils -all;
  3         10247  
  3         29  
9             extends "Types::Standard";
10              
11             declare Text => as "Str", where {
12 1     1   3419 ($_ eq '') || ( is_utf8($_) && ($_ !~ m/[^\P{PosixCntrl}\n]/) )
  1         2  
  1         14  
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;