blib/lib/Cikl/DataTypes/Ipv4.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 18 | 18 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 6 | 6 | 100.0 |
pod | n/a | ||
total | 24 | 24 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Cikl::DataTypes::Ipv4; | ||||||
2 | 2 | 2 | 11 | use strict; | |||
2 | 4 | ||||||
2 | 75 | ||||||
3 | 2 | 2 | 11 | use warnings; | |||
2 | 12 | ||||||
2 | 63 | ||||||
4 | 2 | 2 | 12 | use namespace::autoclean; | |||
2 | 4 | ||||||
2 | 14 | ||||||
5 | 2 | 2 | 155 | use Mouse::Util::TypeConstraints; | |||
2 | 4 | ||||||
2 | 20 | ||||||
6 | 2 | 2 | 1067 | use Regexp::Common qw/net/; | |||
2 | 5462 | ||||||
2 | 12 | ||||||
7 | |||||||
8 | 2 | 2 | 3253 | use constant RE_IPV4 => qr/^$RE{'net'}{'IPv4'}$/; | |||
2 | 6 | ||||||
2 | 15 | ||||||
9 | |||||||
10 | subtype 'Cikl::DataTypes::Ipv4', | ||||||
11 | as 'Str', | ||||||
12 | where { $_ =~ RE_IPV4 }, | ||||||
13 | message { "Invalid Ipv4 address '$_'"} ; | ||||||
14 | |||||||
15 | 1; |