File Coverage

lib/JMAP/Validation/Checks/Address.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             package JMAP::Validation::Checks::Address;
2              
3 5     5   4188 use JMAP::Validation::Checks::Boolean;
  5         10  
  5         122  
4 5     5   1615 use JMAP::Validation::Checks::String;
  5         11  
  5         142  
5 5     5   24 use Test2::Bundle::Extended;
  5         5  
  5         16  
6              
7             our $is_Address = hash {
8             field type => validator(sub {
9             my (%params) = @_;
10             return $params{got} =~ /^(?:home|work|billing|postal|other)$/;
11             });
12              
13             field label => $JMAP::Validation::Checks::String::is_string_or_null;
14             field street => $JMAP::Validation::Checks::String::is_string;
15             field locality => $JMAP::Validation::Checks::String::is_string;
16             field region => $JMAP::Validation::Checks::String::is_string;
17             field postcode => $JMAP::Validation::Checks::String::is_string;
18             field country => $JMAP::Validation::Checks::String::is_string;
19             field isDefault => $JMAP::Validation::Checks::Boolean::is_boolean;
20             end();
21             };
22              
23             1;