blib/lib/Badger/Data/Facet/Text/MaxLength.pm untested

filter: Statementstmt 0.0% 0 / 6 Branchbran n/a Conditioncond 0.0% 0 / 5 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 14 CC 1 SCAR 6.9
CC
1
Cov
0%
validate
2.0
BEGIN
2.0
CRAP 2.0
1 package Badger::Data::Facet::Text::MaxLength;
2  
3 use Badger::Data::Facet::Class
4 version => 0.01,
5 type => 'text',
6 args => 'max_length';
7  
8  
9 sub validate {
10 my ($self, $text, $type) = @_;
11  
12 return length($$text) <= $self->{ max_length }
13 || $self->invalid_msg(
14 too_long => $type || 'Text',
15 $self->{ max_length }, length($$text)
16 );
17 }
18  
19 1;
20  
21 __END__