| 1 | package WWW::Postini::Assert; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use WWW::Postini::Exception::AssertionFailure; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Exporter; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use vars qw( @ISA @EXPORT $VERSION ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | @ISA = qw( Exporter ); | |||||||||||||||||||||||||||
| 12 | 1 | @EXPORT = qw( assert ); | |||||||||||||||||||||||||||
| 13 | 1 | $VERSION = '0.01'; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 515 | ▶ | sub assert { | ||||||||||||||||||||||||||
|
Subroutine
assert: called CC=6 SCAR=19.1
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 515 | my $value = shift; | |||||||||||||||||||||||||||
| 18 | 515 | ▶ | my $description = shift if defined $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 515 | ▶ | unless (defined $value && $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $value and $value
MC/DC50%1/2
defined $value and $value
defined $value
$value
Truth table66%2/3
A and B
A= defined $valueB= $value
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 1 | ▶ | my $description = sprintf 'Assertion%sfailed', | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $description and length $description
MC/DC0%0/2
defined $description and length $description
defined $description
length $description
Truth table33%1/3
A and B
A= defined $descriptionB= length $description
| |||||||||||||||||||||||||||||
| 23 | defined $description && length $description ? " '$description' " : ' ' | ||||||||||||||||||||||||||||
| 24 | ; | ||||||||||||||||||||||||||||
| 25 | 1 | throw WWW::Postini::Exception::AssertionFailure($description); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 514 | 1; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 1 | 1; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||||||||||