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 | 523 | use strict; | |||
1 | 2 | ||||||
1 | 31 | ||||||
4 | 1 | 1 | 5 | use warnings; | |||
1 | 2 | ||||||
1 | 27 | ||||||
5 | |||||||
6 | 1 | 1 | 5 | use parent qw( Net::WebSocket::X::Base ); | |||
1 | 2 | ||||||
1 | 4 | ||||||
7 | |||||||
8 | sub _new { | ||||||
9 | 16 | 16 | 624 | my ($class, $badtoken) = @_; | |||
10 | |||||||
11 | 16 | 23 | my $disp_val = $badtoken; | ||||
12 | 16 | 50 | 37 | $disp_val = q<> if !defined $disp_val; | |||
13 | |||||||
14 | 16 | 55 | return $class->SUPER::_new( | ||||
15 | "“$disp_val” is not a valid HTTP token.", | ||||||
16 | ); | ||||||
17 | } | ||||||
18 | |||||||
19 | 1; |