blib/lib/CBOR/Free/X/InvalidUTF8.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 15 | 15 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | n/a | ||
total | 20 | 20 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package CBOR::Free::X::InvalidUTF8; | ||||||
2 | |||||||
3 | 2 | 2 | 1433 | use strict; | |||
2 | 6 | ||||||
2 | 67 | ||||||
4 | 2 | 2 | 15 | use warnings; | |||
2 | 6 | ||||||
2 | 78 | ||||||
5 | |||||||
6 | 2 | 2 | 12 | use parent qw( CBOR::Free::X::Base ); | |||
2 | 4 | ||||||
2 | 12 | ||||||
7 | |||||||
8 | 2 | 2 | 699 | use Text::Control (); | |||
2 | 382 | ||||||
2 | 180 | ||||||
9 | |||||||
10 | sub _new { | ||||||
11 | 2 | 2 | 454 | my ($class, $bin) = @_; | |||
12 | |||||||
13 | 2 | 8 | $bin = Text::Control::to_hex($bin); | ||||
14 | |||||||
15 | 2 | 100 | return $class->SUPER::_new("Received an invalid UTF-8 string: “$bin”"); | ||||
16 | } | ||||||
17 | |||||||
18 | 1; |