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 | 1394 | use strict; | |||
2 | 4 | ||||||
2 | 73 | ||||||
4 | 2 | 2 | 11 | use warnings; | |||
2 | 5 | ||||||
2 | 81 | ||||||
5 | |||||||
6 | 2 | 2 | 12 | use parent qw( CBOR::Free::X::Base ); | |||
2 | 5 | ||||||
2 | 12 | ||||||
7 | |||||||
8 | 2 | 2 | 677 | use Text::Control (); | |||
2 | 391 | ||||||
2 | 180 | ||||||
9 | |||||||
10 | sub _new { | ||||||
11 | 2 | 2 | 424 | my ($class, $bin) = @_; | |||
12 | |||||||
13 | 2 | 9 | $bin = Text::Control::to_hex($bin); | ||||
14 | |||||||
15 | 2 | 94 | return $class->SUPER::_new("Received an invalid UTF-8 string: “$bin”"); | ||||
16 | } | ||||||
17 | |||||||
18 | 1; |