X/Types.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 80.9% 17 / 21 CC 2 SCAR 6.4
CC
2
Cov
81%
__ANON__
3.7
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
↑ Summary X.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Throwable::X::Types 0.008;
4 # ABSTRACT: private types used by Throwable::X
5  
6 #pod =head1 DESCRIPTION
7 #pod
8 #pod None of the types provided by Throwable::X::Types are meant for public
9 #pod consumption. Please do not rely on them. They are likely to change.
10 #pod
11 #pod =cut
12  
13 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 subtype 'Throwable::X::_VisibleStr',
16 as 'Str',
17 1 ▶ where { length };
Subroutine __ANON__: called CC=1 SCAR=0.0
18  
19 # We don't want vertical whitespace, but we also don't want it to be a format
20 # string, in case we default to it. Rather than being really cagey and
21 # demanding we use %% and then we s/%%/% in the ident, we just forbid it.
22 # Let's not be too clever, just yet. -- rjbs, 2010-10-17
23 subtype 'Throwable::X::_Ident',
24 as 'Throwable::X::_VisibleStr',
25 0 ▶ where { /\S/ && ! /[%\x0d\x0a]/ };
Subroutine __ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
BranchTrueFalseTotal
/\S/ and not /[%\x0d\x0a]/ 0 0 0
26  
27 # Another idea is to mark both lazy and then have a before BUILDALL (or
28 # something) that ensures that at least one is set and allows % in the ident as
29 # long as an explicit message_fmt was given. I think this is probably better.
30 # -- rjbs, 2010-10-17
31  
32 1 1;
33  
34 __END__
↑ Summary X.pm »