| 1 | package Zuzu::Value::Equality; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 79 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 79 | our $VERSION = '0.007002'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 79 | ▶ | use Exporter qw(import); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 79 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||
| 10 | equality_type | ||||||||||||||||||||||||||||
| 11 | value_equal | ||||||||||||||||||||||||||||
| 12 | stable_value_key | ||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 79 | ▶ | use B qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | SVf_IOK | ||||||||||||||||||||||||||||
| 17 | SVf_NOK | ||||||||||||||||||||||||||||
| 18 | SVf_POK | ||||||||||||||||||||||||||||
| 19 | svref_2object | ||||||||||||||||||||||||||||
| 20 | 79 | ); | |||||||||||||||||||||||||||
| 21 | 79 | ▶ | use Scalar::Util qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | blessed | ||||||||||||||||||||||||||||
| 23 | refaddr | ||||||||||||||||||||||||||||
| 24 | 79 | ); | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 252708 | ▶ | sub _scalar_type { | ||||||||||||||||||||||||||
|
Subroutine
_scalar_type: called CC=10 SCAR=30.0
| |||||||||||||||||||||||||||||
| 27 | 252708 | my ( $value ) = @_; | |||||||||||||||||||||||||||
| 28 | 252708 | my $flags = svref_2object( \$value )->FLAGS; | |||||||||||||||||||||||||||
| 29 | 252708 | ▶ | my $is_numeric = ( $flags & ( SVf_IOK | SVf_NOK ) ) ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | 252708 | ▶ | my $is_stringy = ( $flags & SVf_POK ) ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 252708 | ▶ | return 'Number' if $is_numeric and ! $is_stringy; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$is_numeric and not $is_stringy
MC/DC50%1/2
$is_numeric and not $is_stringy
$is_numeric
not $is_stringy
Truth table66%2/3
A and not(B)
A= $is_numericB= not $is_stringy
| |||||||||||||||||||||||||||||
| 33 | 45684 | ▶ | return 'String' if ! $is_numeric and $is_stringy; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $is_numeric and $is_stringy
MC/DC0%0/2
not $is_numeric and $is_stringy
not $is_numeric
$is_stringy
Truth table33%1/3
not(A) and B
A= not $is_numericB= $is_stringy
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | if ( $is_numeric and $is_stringy ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$is_numeric and $is_stringy
MC/DC0%0/2
$is_numeric and $is_stringy
$is_numeric
$is_stringy
Truth table0%0/3
A and B
A= $is_numericB= $is_stringy
| |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | return ( $value =~ /\A-?(?:\d+(?:\.\d+)?)\z/ ) ? 'Number' : 'String'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | return 'String'; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 260857 | ▶ | sub equality_type { | ||||||||||||||||||||||||||
|
Subroutine
equality_type: called CC=5 SCAR=16.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 43 | 260857 | my ( $value ) = @_; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 260857 | ▶ | return 'Null' if ! defined $value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | 253504 | ▶ | if ( blessed($value) and $value->isa('Zuzu::Value::Boolean') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Boolean")
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Boolean")
builtin::blessed($value)
$value->isa("Zuzu::Value::Boolean")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Boolean")
| |||||||||||||||||||||||||||||
| 47 | 0 | return 'Boolean'; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | 253504 | ▶ | if ( ref $value ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 796 | return ref $value; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 252708 | return _scalar_type( $value ); | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 260 | ▶ | sub stable_value_key { | ||||||||||||||||||||||||||
|
Subroutine
stable_value_key: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 57 | 260 | my ( $value ) = @_; | |||||||||||||||||||||||||||
| 58 | 260 | my $type = equality_type( $value ); | |||||||||||||||||||||||||||
| 59 | my %encoders = ( | ||||||||||||||||||||||||||||
| 60 | 1 | ▶ | Null => sub { return 'Null:null'; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 61 | 0 | ▶ | Boolean => sub { return 'Boolean:' . ( $value->value ? '1' : '0' ); }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 62 | 129 | ▶ | Number => sub { return 'Number:' . ( 0 + $value ); }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 63 | 91 | ▶ | String => sub { return 'String:' . $value; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 64 | 260 | ); | |||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 260 | ▶ | if ( exists $encoders{$type} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 221 | return $encoders{$type}->(); | |||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 39 | ▶ | if ( blessed($value) and $value->can('_stable_key') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->can("_stable_key")
MC/DC50%1/2
builtin::blessed($value) and $value->can("_stable_key")
builtin::blessed($value)
$value->can("_stable_key")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->can("_stable_key")
| |||||||||||||||||||||||||||||
| 71 | 6 | return $type . ':' . $value->_stable_key; | |||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 33 | ▶ | return $type . ':' . ( refaddr( $value ) // "$value" ); | ||||||||||||||||||||||||||
|
Condition50%1/2
builtin::refaddr($value) // "$value"
MC/DC0%0/1
builtin::refaddr($value) // "$value"
builtin::refaddr($value)
Truth table50%1/2
A
A= builtin::refaddr($value)
| |||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 18244 | ▶ | sub value_equal { | ||||||||||||||||||||||||||
|
Subroutine
value_equal: called CC=12 SCAR=25.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 78 | 18244 | my ( $left, $right ) = @_; | |||||||||||||||||||||||||||
| 79 | 18244 | my $left_type = equality_type( $left ); | |||||||||||||||||||||||||||
| 80 | 18244 | my $right_type = equality_type( $right ); | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 18244 | ▶ | return 0 if $left_type ne $right_type; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | my %comparators = ( | ||||||||||||||||||||||||||||
| 85 | 3078 | ▶ | Null => sub { return 1; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 86 | 0 | ▶ | Boolean => sub { return $left->value == $right->value ? 1 : 0; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 87 | 261 | ▶ | Number => sub { return ( 0 + $left ) == ( 0 + $right ) ? 1 : 0; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 88 | 13663 | ▶ | String => sub { return $left eq $right ? 1 : 0; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 89 | 17033 | ); | |||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | 17033 | ▶ | if ( exists $comparators{$left_type} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | 17002 | return $comparators{$left_type}->(); | |||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 31 | ▶ | if ( blessed($left) and blessed($right) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($left) and builtin::blessed($right)
MC/DC0%0/2
builtin::blessed($left) and builtin::blessed($right)
builtin::blessed($left)
builtin::blessed($right)
Truth table33%1/3
A and B
A= builtin::blessed($left)B= builtin::blessed($right)
| |||||||||||||||||||||||||||||
| 96 | 31 | ▶ | return 0 if ref($left) ne ref($right); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 31 | ▶ | if ( $left->isa('Zuzu::Value::Array') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 99 | 7 | return _array_equal( $left, $right ); | |||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||
| 101 | 24 | ▶ | if ( $left->isa('Zuzu::Value::Bag') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 102 | 1 | return _bag_equal( $left, $right ); | |||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | 23 | ▶ | if ( $left->isa('Zuzu::Value::Set') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 105 | 1 | return _set_equal( $left, $right ); | |||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | 22 | ▶ | if ( $left->isa('Zuzu::Value::Dict') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 108 | 4 | return _dict_equal( $left, $right ); | |||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||
| 110 | 18 | ▶ | if ( $left->isa('Zuzu::Value::PairList') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 111 | 2 | return _pairlist_equal( $left, $right ); | |||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | 16 | ▶ | return stable_value_key( $left ) eq stable_value_key( $right ) ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | 7 | ▶ | sub _array_equal { | ||||||||||||||||||||||||||
|
Subroutine
_array_equal: called CC=6 SCAR=19.0
| |||||||||||||||||||||||||||||
| 119 | 7 | my ( $left, $right ) = @_; | |||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | 7 | ▶ | my $left_items = $left->items // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$left->items // []
MC/DC0%0/1
$left->items // []
$left->items
Truth table50%1/2
A
A= $left->items
| |||||||||||||||||||||||||||||
| 122 | 7 | ▶ | my $right_items = $right->items // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$right->items // []
MC/DC0%0/1
$right->items // []
$right->items
Truth table50%1/2
A
A= $right->items
| |||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | 7 | ▶ | return 0 if @$left_items != @$right_items; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | 7 | for my $i ( 0 .. $#$left_items ) { | |||||||||||||||||||||||||||
| 127 | 12 | ▶ | return 0 if !value_equal( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 128 | $left->_value_at($i), | ||||||||||||||||||||||||||||
| 129 | $right->_value_at($i), | ||||||||||||||||||||||||||||
| 130 | ); | ||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | 7 | return 1; | |||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | 1 | ▶ | sub _bag_equal { | ||||||||||||||||||||||||||
|
Subroutine
_bag_equal: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||
| 137 | 1 | my ( $left, $right ) = @_; | |||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | my @left_items = sort { | ||||||||||||||||||||||||||||
| 140 | 1 | stable_value_key( $a ) cmp stable_value_key( $b ) | |||||||||||||||||||||||||||
| 141 | } $left->resolved_items; | ||||||||||||||||||||||||||||
| 142 | my @right_items = sort { | ||||||||||||||||||||||||||||
| 143 | 1 | stable_value_key( $a ) cmp stable_value_key( $b ) | |||||||||||||||||||||||||||
| 144 | } $right->resolved_items; | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | 1 | ▶ | return 0 if @left_items != @right_items; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | 1 | for my $i ( 0 .. $#left_items ) { | |||||||||||||||||||||||||||
| 149 | 2 | ▶ | return 0 if !value_equal( $left_items[$i], $right_items[$i] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | 1 | return 1; | |||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | 1 | ▶ | sub _set_equal { | ||||||||||||||||||||||||||
|
Subroutine
_set_equal: called CC=5 SCAR=16.5
| |||||||||||||||||||||||||||||
| 156 | 1 | my ( $left, $right ) = @_; | |||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | 1 | for my $left_item ( $left->resolved_items ) { | |||||||||||||||||||||||||||
| 159 | 2 | ▶ | return 0 if !$right->contains( $left_item ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||
| 161 | 1 | for my $right_item ( $right->resolved_items ) { | |||||||||||||||||||||||||||
| 162 | 2 | ▶ | return 0 if !$left->contains( $right_item ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 1 | return 1; | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | 4 | ▶ | sub _dict_equal { | ||||||||||||||||||||||||||
|
Subroutine
_dict_equal: called CC=8 SCAR=21.8
| |||||||||||||||||||||||||||||
| 169 | 4 | my ( $left, $right ) = @_; | |||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | 4 | ▶ | my @left_keys = sort CORE::keys %{ $left->map // {} }; | ||||||||||||||||||||||||||
|
Condition50%1/2
$left->map // {}
MC/DC0%0/1
$left->map // {}
$left->map
Truth table50%1/2
A
A= $left->map
| |||||||||||||||||||||||||||||
| 172 | 4 | ▶ | my @right_keys = sort CORE::keys %{ $right->map // {} }; | ||||||||||||||||||||||||||
|
Condition50%1/2
$right->map // {}
MC/DC0%0/1
$right->map // {}
$right->map
Truth table50%1/2
A
A= $right->map
| |||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 4 | ▶ | return 0 if @left_keys != @right_keys; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | 4 | for my $i ( 0 .. $#left_keys ) { | |||||||||||||||||||||||||||
| 177 | 5 | ▶ | return 0 if !value_equal( $left_keys[$i], $right_keys[$i] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | 4 | for my $key ( @left_keys ) { | |||||||||||||||||||||||||||
| 180 | 5 | ▶ | return 0 if !value_equal( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 181 | $left->_value_for_key($key), | ||||||||||||||||||||||||||||
| 182 | $right->_value_for_key($key), | ||||||||||||||||||||||||||||
| 183 | ); | ||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | 4 | return 1; | |||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | 2 | ▶ | sub _pairlist_equal { | ||||||||||||||||||||||||||
|
Subroutine
_pairlist_equal: called CC=9 SCAR=24.0
| |||||||||||||||||||||||||||||
| 190 | 2 | my ( $left, $right ) = @_; | |||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | 2 | ▶ | my $left_pairs = $left->list // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$left->list // []
MC/DC0%0/1
$left->list // []
$left->list
Truth table50%1/2
A
A= $left->list
| |||||||||||||||||||||||||||||
| 193 | 2 | ▶ | my $right_pairs = $right->list // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$right->list // []
MC/DC0%0/1
$right->list // []
$right->list
Truth table50%1/2
A
A= $right->list
| |||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | 2 | ▶ | return 0 if @$left_pairs != @$right_pairs; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 2 | for my $i ( 0 .. $#$left_pairs ) { | |||||||||||||||||||||||||||
| 198 | 2 | ▶ | my $left_pair = $left_pairs->[$i] // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$left_pairs->[$i] // []
MC/DC0%0/1
$left_pairs->[$i] // []
$left_pairs->[$i]
Truth table50%1/2
A
A= $left_pairs->[$i]
| |||||||||||||||||||||||||||||
| 199 | 2 | ▶ | my $right_pair = $right_pairs->[$i] // []; | ||||||||||||||||||||||||||
|
Condition50%1/2
$right_pairs->[$i] // []
MC/DC0%0/1
$right_pairs->[$i] // []
$right_pairs->[$i]
Truth table50%1/2
A
A= $right_pairs->[$i]
| |||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | 2 | ▶ | return 0 if !value_equal( $left_pair->[0], $right_pair->[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 202 | 2 | ▶ | return 0 if !value_equal( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 203 | $left->_value_at($i), | ||||||||||||||||||||||||||||
| 204 | $right->_value_at($i), | ||||||||||||||||||||||||||||
| 205 | ); | ||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | 2 | return 1; | |||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | 79 | 1; | |||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | =pod | ||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | =head1 COPYRIGHT AND LICENCE | ||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | B<< Zuzu::Value::Equality >> is copyright Toby Inkster. | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | It is free software; you may redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 220 | the terms of either the Artistic License 1.0 or the GNU General Public | ||||||||||||||||||||||||||||
| 221 | License version 2. | ||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | =cut | ||||||||||||||||||||||||||||