WebSocket/X/BadArg.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 25 CC 3 SCAR 19.5
CC
3
Cov
0%
_new
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 7.0
1 package Net::WebSocket::X::BadArg;
2  
3 use strict;
4 use warnings;
5  
6 use parent qw( Net::WebSocket::X::Base );
7  
8 sub _new {
9 my ($class, $name, $val, $why) = @_;
10  
11 my $caller = (caller 1)[3];
12  
13 if ($why) {
14 return $class->SUPER::_new(
15 "$caller: invalid “$name” ($val) - $why",
16 name => $name,
17 value => $val,
18 why => $why,
19 );
20 }
21  
22 my $disp_val = $val;
23 $disp_val = q<> if !defined $val;
24  
25 return $class->SUPER::_new(
26 sprintf("%s: invalid “%s” (%s)", $caller, $name, $disp_val),
27 name => $name,
28 value => $val,
29 );
30 }
31  
32 1;