File Coverage

blib/lib/Throwable/X/Types.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1 1     1   6 use strict;
  1         2  
  1         25  
2 1     1   4 use warnings;
  1         2  
  1         32  
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     1   4 use Moose::Util::TypeConstraints;
  1         2  
  1         6  
14              
15             subtype 'Throwable::X::_VisibleStr',
16             as 'Str',
17             where { length };
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             where { /\S/ && ! /[%\x0d\x0a]/ };
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;
33              
34             __END__
35              
36             =pod
37              
38             =encoding UTF-8
39              
40             =head1 NAME
41              
42             Throwable::X::Types - private types used by Throwable::X
43              
44             =head1 VERSION
45              
46             version 0.008
47              
48             =head1 DESCRIPTION
49              
50             None of the types provided by Throwable::X::Types are meant for public
51             consumption. Please do not rely on them. They are likely to change.
52              
53             =head1 PERL VERSION
54              
55             This library should run on perls released even a long time ago. It should work
56             on any version of perl released in the last five years.
57              
58             Although it may work on older versions of perl, no guarantee is made that the
59             minimum required version will not be increased. The version may be increased
60             for any reason, and there is no promise that patches will be accepted to lower
61             the minimum required perl.
62              
63             =head1 AUTHOR
64              
65             Ricardo Signes <cpan@semiotic.systems>
66              
67             =head1 COPYRIGHT AND LICENSE
68              
69             This software is copyright (c) 2022 by Ricardo Signes.
70              
71             This is free software; you can redistribute it and/or modify it under
72             the same terms as the Perl 5 programming language system itself.
73              
74             =cut