blib/lib/Net/WebSocket/X/BadToken.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 13 | 100.0 |
branch | 1 | 2 | 50.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | n/a | ||
total | 18 | 19 | 94.7 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Net::WebSocket::X::BadToken; | ||||||
2 | |||||||
3 | 1 | 1 | 511 | use strict; | |||
1 | 3 | ||||||
1 | 29 | ||||||
4 | 1 | 1 | 5 | use warnings; | |||
1 | 5 | ||||||
1 | 29 | ||||||
5 | |||||||
6 | 1 | 1 | 5 | use parent qw( Net::WebSocket::X::Base ); | |||
1 | 3 | ||||||
1 | 4 | ||||||
7 | |||||||
8 | sub _new { | ||||||
9 | 16 | 16 | 619 | my ($class, $badtoken) = @_; | |||
10 | |||||||
11 | 16 | 21 | my $disp_val = $badtoken; | ||||
12 | 16 | 50 | 36 | $disp_val = q<> if !defined $disp_val; | |||
13 | |||||||
14 | 16 | 56 | return $class->SUPER::_new( | ||||
15 | "“$disp_val” is not a valid HTTP token.", | ||||||
16 | ); | ||||||
17 | } | ||||||
18 | |||||||
19 | 1; |