| 1 | package ICANN::RST::Case; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: an object representing an RST test case. | ||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use List::Util qw(any); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use base qw(ICANN::RST::Base); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub summary { $_[0]->{'Summary'} } | ||||||||||||||||||||||||||
|
Subroutine
summary: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub description { ICANN::RST::Text->new($_[0]->{'Description'}) } | ||||||||||||||||||||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub maturity { $_[0]->{'Maturity'} || 'ALPHA' } | ||||||||||||||||||||||||||
|
Subroutine
maturity: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub title { | ||||||||||||||||||||||||||
|
Subroutine
title: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | if ($self->summary) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | 0 | return sprintf('%s - %s', $self->id, $self->summary); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | } else { | ||||||||||||||||||||||||||||
| 18 | 0 | return $self->id; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub inputs { | ||||||||||||||||||||||||||
|
Subroutine
inputs: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | return sort { $a->id cmp $b->id } map { $self->spec->input($_) } @{$self->{'Input-Parameters'}}; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub resources { | ||||||||||||||||||||||||||
|
Subroutine
resources: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | return sort { $a->id cmp $b->id } map { $self->spec->resource($_) } @{$self->{'Resources'}}; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub errors { | ||||||||||||||||||||||||||
|
Subroutine
errors: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | return sort { $a->id cmp $b->id } map { $self->spec->error($_) } @{$self->{'Errors'}}; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub providers { | ||||||||||||||||||||||||||
|
Subroutine
providers: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 42 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | return sort { $a->id cmp $b->id } map { $self->spec->provider($_) } @{$self->{'Data-Providers'}}; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub dependencies { | ||||||||||||||||||||||||||
|
Subroutine
dependencies: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 48 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | return sort { $a->id cmp $b->id } map { $self->spec->case($_) } @{$self->{'Dependencies'}}; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | sub dependants { | ||||||||||||||||||||||||||
|
Subroutine
dependants: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 54 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | my @cases; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | foreach my $case ($self->spec->cases) { | |||||||||||||||||||||||||||
| 59 | 0 | ▶ | push(@cases, $case) if (any { $_->id eq $self->id } $case->dependencies); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | return sort { $a->id cmp $b->id } @cases; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | ▶ | sub suites { | ||||||||||||||||||||||||||
|
Subroutine
suites: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 66 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 0 | my %suites; | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 0 | foreach my $suite ($self->spec->suites) { | |||||||||||||||||||||||||||
| 71 | 0 | foreach my $case ($suite->cases) { | |||||||||||||||||||||||||||
| 72 | 0 | ▶ | $suites{$suite->id} = $suite if ($case->id eq $self->id && !defined($suites{$suite->id})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$case->id eq $self->id and not defined $suites{$suite->id}
MC/DC0%0/2
$case->id eq $self->id and not defined $suites{$suite->id}
$case->id eq $self->id
not defined $suites{$suite->id}
Truth table0%0/3
A and not(B)
A= $case->id eq $self->idB= not defined $suites{$suite->id}
| |||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 0 | return sort { $a->order <=> $b->order } values(%suites); | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 1 | 1; | |||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | __END__ | ||||||||||||||||||||||||||||