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