| 1 | package Error::TypeTiny::WrongNumberOfParameters; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 83 | ▶ | use 5.008001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 83 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 83 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 83 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 83 | $Error::TypeTiny::WrongNumberOfParameters::AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 83 | $Error::TypeTiny::WrongNumberOfParameters::VERSION = '2.010001'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 83 | $Error::TypeTiny::WrongNumberOfParameters::VERSION =~ tr/_//d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 83 | require Error::TypeTiny; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 83 | our @ISA = 'Error::TypeTiny'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 79 | ▶ | sub minimum { $_[0]{minimum} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
minimum: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 59 | ▶ | sub maximum { $_[0]{maximum} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
maximum: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 58 | ▶ | sub got { $_[0]{got} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
got: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 19 | ▶ | sub target { $_[0]{target} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
target: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 120 | ▶ | sub has_minimum { exists $_[0]{minimum} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_minimum: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 74 | ▶ | sub has_maximum { exists $_[0]{maximum} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_maximum: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 53 | ▶ | sub has_target { exists $_[0]{target} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_target: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 53 | ▶ | sub _build_message { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_message: called CC=10 SCAR=23.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 53 | my $e = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 53 | my $base = 'Wrong number of parameters'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 53 | ▶ | if ( $e->has_target ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 19 | $base .= sprintf( ' to %s', $e->target ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 53 | ▶ | if ( $e->has_minimum and $e->has_maximum and $e->minimum == $e->maximum ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition100%6/6
$e->has_minimum and $e->has_maximum and $e->minimum == $e->maximum
$e->has_minimum and $e->has_maximum
MC/DC100%3/3
$e->has_minimum and $e->has_maximum and $e->minimum == $e->maximum
$e->has_minimum
$e->has_maximum
$e->minimum == $e->maximum
Truth table100%4/4
A and B and C
A= $e->has_minimumB= $e->has_maximumC= $e->minimum == $e->maximum
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 16 | return sprintf( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | "%s; got %d; expected %d", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | $base, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | $e->got, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | $e->minimum, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | ▶ | elsif ( $e->has_minimum and $e->has_maximum and $e->minimum < $e->maximum ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%6/6
$e->has_minimum and $e->has_maximum and $e->minimum < $e->maximum
$e->has_minimum and $e->has_maximum
MC/DC100%3/3
$e->has_minimum and $e->has_maximum and $e->minimum < $e->maximum
$e->has_minimum
$e->has_maximum
$e->minimum < $e->maximum
Truth table100%4/4
A and B and C
A= $e->has_minimumB= $e->has_maximumC= $e->minimum < $e->maximum
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 12 | return sprintf( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | "%s; got %d; expected %d to %d", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | $base, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | $e->got, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | $e->minimum, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | $e->maximum, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | elsif ( $e->has_minimum ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 4 | return sprintf( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | "%s; got %d; expected at least %d", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | $base, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | $e->got, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | $e->minimum, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | elsif ( $e->has_maximum ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | return sprintf( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | "%s; got %d; expected at most %d", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | $base, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | $e->got, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | $e->maximum, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 21 | return sprintf( | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | "%s; got %d", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | $base, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | $e->got, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } #/ sub _build_message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 83 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||