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