| 1 | 18 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 18 | ▶ | use warnings FATAL => 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | package HTML::Tested::Test::Radio; | ||||||||||
| 5 | 18 | ▶ | use base 'HTML::Tested::Test::Value'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 19 | ▶ | sub _grep_my_vars { | ||||||||
|
Subroutine
_grep_my_vars: called CC=3 SCAR=11.0
| |||||||||||
| 8 | 19 | my ($class, $name, $stash) = @_; | |||||||||
| 9 | 19 | my @res; | |||||||||
| 10 | 19 | ▶ | while (my ($n, $v) = each %$stash) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 55 | ▶ | next unless $n =~ /^$name\_/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 55 | push @res, $n; | |||||||||
| 13 | } | ||||||||||
| 14 | 19 | return @res; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 7 | ▶ | sub check_stash { | ||||||||
|
Subroutine
check_stash: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 18 | 7 | my ($class, $e_root, $name, $e_stash, $r_stash) = @_; | |||||||||
| 19 | 7 | my @err; | |||||||||
| 20 | 7 | for my $n ($class->_grep_my_vars($name, $e_stash)) { | |||||||||
| 21 | 20 | my $e_val = $e_stash->{$n}; | |||||||||
| 22 | 20 | my $r_val = HTML::Tested::Test::Ensure_Value_To_Check( | |||||||||
| 23 | $r_stash, $n, $e_val, \@err); | ||||||||||
| 24 | 20 | ▶ | next unless defined($r_val); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 19 | ▶ | next if ($r_val eq $e_val); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 1 | push @err, HTML::Tested::Test::Stash_Mismatch( | |||||||||
| 27 | $n, $r_val, $e_val); | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 7 | for my $n ($class->_grep_my_vars($name, $r_stash)) { | |||||||||
| 31 | 20 | ▶ | next if exists $e_stash->{$n}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | push @err, HTML::Tested::Test::Stash_Mismatch( | ||||||||||
| 33 | 1 | $n, $r_stash->{$n}, undef); | |||||||||
| 34 | } | ||||||||||
| 35 | 7 | return @err; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 5 | ▶ | sub check_text { | ||||||||
|
Subroutine
check_text: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 39 | 5 | my ($class, $e_root, $name, $e_stash, $text) = @_; | |||||||||
| 40 | return map { | ||||||||||
| 41 | 5 | $class->_check_text_i($e_root, $name, $e_stash->{$_}, $text) | |||||||||
| 42 | } $class->_grep_my_vars($name, $e_stash); | ||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 18 | 1; | |||||||||