| 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; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 18 | ▶ | use base 'Exporter'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 18 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 18 | ▶ | use Text::Diff; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 18 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 18 | our @EXPORT_OK = qw(Register_Widget_Tester Stash_Mismatch Ensure_Value_To_Check); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 34 | ▶ | sub Stash_Mismatch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
Stash_Mismatch: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 34 | my ($n, $res, $v) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 34 | ▶ | my $ret = sprintf("Mismatch at %s: got %s, expected %s", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | $n, defined($res) ? "\"$res\"" : "undef", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | defined($v) ? "\"$v\"" : "undef"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 34 | ▶ | goto OUT unless (defined($res) && defined($v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
defined $res and defined $v and $res =~ /\n.*\n/ms and $v =~ /\n.*\n/ms
defined $res and defined $v and $res =~ /\n.*\n/ms
defined $res and defined $v
MC/DC75%3/4
defined $res and defined $v and $res =~ /\n.*\n/ms and $v =~ /\n.*\n/ms
defined $res
defined $v
$res =~ /\n.*\n/ms
$v =~ /\n.*\n/ms
Truth table80%4/5
A and B and C and D
A= defined $resB= defined $vC= $res =~ /\n.*\n/msD= $v =~ /\n.*\n/ms
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | && $res =~ /\n.*\n/ms && $v =~ /\n.*\n/ms); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | $ret .= ". The diff is\n" . diff(\$v, \$res); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 34 | OUT: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | return $ret; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 86 | ▶ | sub Ensure_Value_To_Check { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
Ensure_Value_To_Check: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 86 | my ($r_stash, $name, $e_val, $errs) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 86 | my $r_val = $r_stash->{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 86 | ▶ | return if (!defined($r_val) && !defined($e_val)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $r_val or defined $e_val
MC/DC0%0/2
defined $r_val or defined $e_val
defined $r_val
defined $e_val
Truth table66%2/3
A or B
A= defined $r_valB= defined $e_val
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 86 | ▶ | if (defined($r_val) xor defined($e_val)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
defined $r_val xor defined $e_val
MC/DC50%1/2
defined $r_val xor defined $e_val
defined $r_val
defined $e_val
Truth table50%2/4
A xor B
A= defined $r_valB= defined $e_val
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 3 | push @$errs, Stash_Mismatch($name, $r_val, $e_val); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 83 | return $r_val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 82 | ▶ | sub compare_stashes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
compare_stashes: called CC=5 SCAR=17.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 82 | my ($class, $e_root, $stash, $e_stash) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 82 | ▶ | return () if (!defined($stash) && !defined($e_stash)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $stash or defined $e_stash
MC/DC0%0/2
defined $stash or defined $e_stash
defined $stash
defined $e_stash
Truth table33%1/3
A or B
A= defined $stashB= defined $e_stash
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 82 | ▶ | if (defined($stash) xor defined($e_stash)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
defined $stash xor defined $e_stash
MC/DC50%1/2
defined $stash xor defined $e_stash
defined $stash
defined $e_stash
Truth table50%2/4
A xor B
A= defined $stashB= defined $e_stash
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | return ("Stash " . Dumper($stash) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | . "differ from " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | . "expected " . Dumper($e_stash)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 81 | return $class->_run_checks('stash', $e_root, $stash, $e_stash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 108 | ▶ | sub _run_checks { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_run_checks: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 108 | my ($class, $check, $e_root, $res, $e_stash) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 108 | my $f = "check_$check"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | return map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 106 | $_->__ht_tester->$f($e_root, $_->name, $e_stash, $res); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 108 | } @{ $e_root->Widgets_List }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 27 | ▶ | sub compare_text_to_stash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
compare_text_to_stash: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 27 | my ($class, $e_root, $text, $e_stash) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 27 | return $class->_run_checks('text', $e_root, $text, $e_stash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 18 | my $_index = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 105 | ▶ | sub Make_Expected_Class { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
Make_Expected_Class: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 105 | my ($target_class, $expected) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 105 | my $package = "$target_class\::__HT_TESTER_" . $_index++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 18 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 105 | push @{ *{ "$package\::ISA" } }, $target_class | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 105 | ▶ | unless @{ *{ "$package\::ISA" } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 105 | my $wl = $target_class->Widgets_List; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | $package->Widgets_List([ grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 105 | exists($expected->{ $_->name }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } @$wl ]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 105 | return $package; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 2 | ▶ | sub bless_unknown_widget { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bless_unknown_widget: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | my ($class, $n, $v, $err) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 2 | push @$err, "Unknown widget $n found in expected!"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 2 | return $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 105 | ▶ | sub bless_from_tree_for_test { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bless_from_tree_for_test: called CC=14 SCAR=26.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 105 | my ($class, $target, $expected, $err) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 105 | my $res = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 105 | my (@disabled, %e, @reverted, @sealed, @unsorted); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 105 | ▶ | while (my ($n, $v) = each %$expected) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 104 | my $rev = ($n =~ s/^HT_NO_//); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 104 | my $sealed = ($n =~ s/^HT_SEALED_//); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 104 | my $unsorted = ($n =~ s/^HT_UNSORTED_//); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 104 | ▶ | push @reverted, $n if $rev; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 104 | ▶ | push @sealed, $n if $sealed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 104 | ▶ | push @unsorted, $n if $unsorted; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 104 | $e{$n} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 105 | $expected = \%e; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 105 | my $e_class = Make_Expected_Class($target, $expected); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 105 | ▶ | while (my ($n, $v) = each %$expected) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 104 | ▶ | if (defined($v) && !ref($v) && $v eq 'HT_DISABLED') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
defined $v and not ref $v and $v eq "HT_DISABLED"
defined $v and not ref $v
MC/DC100%3/3
defined $v and not ref $v and $v eq "HT_DISABLED"
defined $v
not ref $v
$v eq "HT_DISABLED"
Truth table100%4/4
A and not(B) and C
A= defined $vB= not ref $vC= $v eq "HT_DISABLED"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | push @disabled, $n; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 1 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 103 | my $wc = $e_class->ht_find_widget($n); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 103 | ▶ | $res->{$n} = $wc ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | $wc->__ht_tester->bless_from_tree($wc, $v, $err) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | : $class->bless_unknown_widget($n, $v, $err); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 104 | my $e_root = bless($res, $e_class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 104 | $e_root->ht_set_widget_option($_, "is_disabled", 1) for @disabled; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 104 | $e_root->{"__HT_REVERTED__$_"} = 1 for @reverted; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 104 | $e_root->{"__HT_SEALED__$_"} = 1 for @sealed; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 104 | $e_root->{"__HT_UNSORTED__$_"} = 1 for @unsorted; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 104 | return $e_root; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 71 | ▶ | sub do_comparison { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
do_comparison: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 71 | my ($class, $compare, $obj_class, $stash, $expected) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 71 | my $e_stash = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 71 | my @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 71 | my $e_root = $class->bless_from_tree_for_test($obj_class | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | , $expected, \@res); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 70 | $e_root->_ht_render_i($e_stash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 69 | push @res, $class->$compare($e_root, $stash, $e_stash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 69 | return @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 52 | ▶ | sub check_stash { return shift()->do_comparison('compare_stashes', @_); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_stash: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 19 | ▶ | sub check_text { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_text: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 19 | return shift()->do_comparison('compare_text_to_stash', @_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | =head2 Register_Widget_Tester($widget_class, $tester_class) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | Registers C<$tester_class> as tester for C<$widget_class>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 73 | ▶ | sub Register_Widget_Tester { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
Register_Widget_Tester: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 73 | my ($w_class, $t_class) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 18 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 73 | ▶ | *{ "$w_class\::__ht_tester" } = sub { return $t_class; }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | sub _tree_to_param_fallback { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_tree_to_param_fallback: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | my ($class, $n) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | confess "Unable to find widget for $n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 15 | ▶ | sub convert_tree_to_param { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_tree_to_param: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 15 | my ($class, $obj_class, $r, $tree, $parent_name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 15 | ▶ | while (my ($n, $v) = each %$tree) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 19 | my $sealit = ($n =~ s/^HT_SEALED_//); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 19 | my $wc = $obj_class->ht_find_widget($n); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 19 | ▶ | if ($wc) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 19 | ▶ | $v = $wc->__ht_tester->convert_to_sealed($v) if $sealit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 19 | ▶ | $wc->__ht_tester->convert_to_param($wc, $r, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | $parent_name ? $parent_name . "__$n" : $n, $v); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $class->_tree_to_param_fallback($n); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 18 | my %_testers = qw(HTML::Tested::Value HTML::Tested::Test::Value | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | HTML::Tested::Value::Upload HTML::Tested::Test::Upload | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | HTML::Tested::Value::Radio HTML::Tested::Test::Radio | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | HTML::Tested::List HTML::Tested::Test::List); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 18 | ▶ | while (my ($n, $v) = each %_testers) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 18 | ▶ | eval "use $n; use $v;"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 72 | ▶ | die "Unable to use $n or use $v" if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 72 | Register_Widget_Tester($n, $v); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 18 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||