Lines 135-141
subtest 'relationships_debt() tests' => sub {
Link Here
|
135 |
|
135 |
|
136 |
sub _test_combinations { |
136 |
sub _test_combinations { |
137 |
my ( $patrons, $parent1_debt, $parent2_debt, $child1_debt, $child2_debt ) = @_; |
137 |
my ( $patrons, $parent1_debt, $parent2_debt, $child1_debt, $child2_debt ) = @_; |
138 |
diag("Testing with parent 1 debt $parent1_debt | Parent 2 debt $parent2_debt | Child 1 debt $child1_debt | Child 2 debt $child2_debt"); |
138 |
note("Testing with parent 1 debt $parent1_debt | Parent 2 debt $parent2_debt | Child 1 debt $child1_debt | Child 2 debt $child2_debt"); |
139 |
# Options |
139 |
# Options |
140 |
# P1 => P1 + C1 + C2 ( - P1 ) ( + P2 ) |
140 |
# P1 => P1 + C1 + C2 ( - P1 ) ( + P2 ) |
141 |
# P2 => P2 + C1 + C2 ( - P2 ) ( + P1 ) |
141 |
# P2 => P2 + C1 + C2 ( - P2 ) ( + P1 ) |
Lines 146-152
sub _test_combinations {
Link Here
|
146 |
for my $i ( 0 .. 7 ) { |
146 |
for my $i ( 0 .. 7 ) { |
147 |
my ( $only_this_guarantor, $include_guarantors, $include_this_patron ) |
147 |
my ( $only_this_guarantor, $include_guarantors, $include_this_patron ) |
148 |
= split '', sprintf( "%03b", $i ); |
148 |
= split '', sprintf( "%03b", $i ); |
149 |
diag("---------------------"); |
149 |
note("---------------------"); |
150 |
for my $patron ( @$patrons ) { |
150 |
for my $patron ( @$patrons ) { |
151 |
if ( $only_this_guarantor |
151 |
if ( $only_this_guarantor |
152 |
&& !$patron->guarantee_relationships->count ) |
152 |
&& !$patron->guarantee_relationships->count ) |