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