SQL/Abstract/Test.pm

filter: Statementstmt 68.7% 108 / 157 Branchbran 66.1% 45 / 68 Conditioncond 47.4% 28 / 59 MC/DCmcdc 32.4% 12 / 37 Subroutinesub 72.7% 16 / 22 Podpod 66.6% 6 / 9 totaltotal 61.0% 215 / 352 CC 55 SCAR 30.6
CC
55
Cov
64%
_sql_differ_diag
56.0
_eq_sql
33.9
__ANON__
12.0
CRAP 21.3
« SQL/Abstract.pm ↑ Summary SQL/Abstract/Plugin/BangOverrides.pm »
1 package SQL::Abstract::Test; # see doc at end of file
2  
3 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use base qw(Test::Builder::Module);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use Test::Builder;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 16 ▶use Test::Deep ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 16 ▶use SQL::Abstract::Tree;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 {
11 16 my $class;
12 16 ▶ if ($class = $ENV{SQL_ABSTRACT_TEST_AGAINST}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($class = $ENV{"SQL_ABSTRACT_TEST_AGAINST"}) 0 16 16
13 0 my $mod = join('/', split '::', $class).".pm";
14 0 require $mod;
15 0 ▶ eval qq{sub SQL::Abstract () { "\Q${class}\E" }; 1}
Branch: 1 branch
BranchTrueFalseTotal
eval qq[sub SQL::Abstract () { "\Q$class\E" }; 1] or die "Failed to create const sub for ${class}: $@" 0 0 0
16 or die "Failed to create const sub for ${class}: $@";
17 }
18 16 ▶ if ($ENV{SQL_ABSTRACT_TEST_EXPAND_STABILITY}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"SQL_ABSTRACT_TEST_EXPAND_STABILITY"}) 0 16 16
19 0 ▶ $class ||= do { require SQL::Abstract; 'SQL::Abstract' };
Condition0%0/3
$class ||= do { require SQL::Abstract; "SQL::Abstract" }
l!l&&r!l&&!r
000
MC/DC0%0/2
$class ||= do { require SQL::Abstract; "SQL::Abstract" }
$class do { require SQL::Abstract; "SQL::Abstract" }
Truth table0%0/3
A ||= B
A= $classB= do { require SQL::Abstract; "SQL::Abstract" }
ABresult
1X1
011
000
20 0 my $orig = $class->can('expand_expr');
21 0 require Data::Dumper::Concise;
22 0 ▶ my $wrapped = sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
23 0 my ($self, @args) = @_;
24 0 my $e1 = $self->$orig(@args);
25 0 ▶ return $e1 if our $Stab_Check_Rec;
Branch: 1 branch
BranchTrueFalseTotal
if our $Stab_Check_Rec 0 0 0
26 0 local $Stab_Check_Rec = 1;
27 0 my $e2 = $self->$orig($e1);
28 0 my ($d1, $d2) = map Data::Dumper::Concise::Dumper($_), $e1, $e2;
29 (our $tb)->is_eq(
30 $d2, $d1,
31 'expand_expr stability ok'
32 0 ▶ ) or do {
Branch: 1 branch
BranchTrueFalseTotal
our $tb->is_eq($d2, $d1, "expand_expr stability ok") or do { require Path::Tiny; "Path::Tiny"->new("e1")->spew($d1); "Path::Tiny"->new("e2")->spew($d2); system "diff -u e1 e2 1>&2"; die "Differences between e1 and e2, bailing out" } 0 0 0
33 0 require Path::Tiny;
34 0 Path::Tiny->new('e1')->spew($d1);
35 0 Path::Tiny->new('e2')->spew($d2);
36 0 system('diff -u e1 e2 1>&2');
37 0 die "Differences between e1 and e2, bailing out";
38 };
39 0 return $e1;
40 0 };
41 16 ▶ no strict 'refs'; no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
42 0 *{"${class}::expand_expr"} = $wrapped;
43 }
44 }
45  
46 16 our @EXPORT_OK = qw(
47 is_same_sql_bind is_same_sql is_same_bind
48 eq_sql_bind eq_sql eq_bind dumper diag_where
49 $case_sensitive $sql_differ
50 );
51  
52 16 my $sqlat = SQL::Abstract::Tree->new;
53  
54 16 our $case_sensitive = 0;
55 16 our $parenthesis_significant = 0;
56 16 our $order_by_asc_significant = 0;
57  
58 16 our $sql_differ; # keeps track of differing portion between SQLs
59 16 our $tb; # not documented, but someone might be overriding it anyway
60  
61 578 ▶sub _unpack_arrayrefref {
Subroutine _unpack_arrayrefref: called CC=4 SCAR=13.9
62  
63 578 my @args;
64 578 for (1,2) {
65 1156 my $chunk = shift @_;
66  
67 1156 ▶ if (ref $chunk eq 'REF' and ref $$chunk eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $chunk eq 'REF' and ref $$chunk eq 'ARRAY') { } 3 1153 1156
Condition66%2/3
ref $chunk eq "REF" and ref $$chunk eq "ARRAY"
!ll&&!rl&&r
115303
MC/DC50%1/2
ref $chunk eq "REF" and ref $$chunk eq "ARRAY"
ref $chunk eq "REF" ref $$chunk eq "ARRAY"
Truth table66%2/3
A and B
A= ref $chunk eq "REF"B= ref $$chunk eq "ARRAY"
ABresult
0X0
100
111
68 3 my ($sql, @bind) = @$$chunk;
69 3 push @args, ($sql, \@bind);
70 }
71 else {
72 1153 push @args, $chunk, shift @_;
73 }
74  
75 }
76  
77 # maybe $msg and ... stuff
78 578 push @args, @_;
79  
80 578 @args;
81 }
82  
83 574 ▶sub is_same_sql_bind {
Subroutine is_same_sql_bind: called CC=5 SCAR=18.9
Pod documented
84 574 my ($sql1, $bind_ref1, $sql2, $bind_ref2, $msg) = &_unpack_arrayrefref;
85  
86 # compare
87 574 my $same_sql = eq_sql($sql1, $sql2);
88 574 my $same_bind = eq_bind($bind_ref1, $bind_ref2);
89  
90 # call Test::Builder::ok
91 574 ▶ my $tb = $tb || __PACKAGE__->builder;
Condition33%1/3
$SQL::Abstract::Test::tb || __PACKAGE__->builder
l!l&&r!l&&!r
05740
MC/DC0%0/2
$SQL::Abstract::Test::tb || __PACKAGE__->builder
$SQL::Abstract::Test::tb __PACKAGE__->builder
Truth table33%1/3
A || B
A= $SQL::Abstract::Test::tbB= __PACKAGE__->builder
ABresult
1X1
011
000
92 574 ▶ my $ret = $tb->ok($same_sql && $same_bind, $msg);
Condition33%1/3
$same_sql && $same_bind
!ll&&!rl&&r
00574
MC/DC0%0/2
$same_sql && $same_bind
$same_sql $same_bind
Truth table33%1/3
A && B
A= $same_sqlB= $same_bind
ABresult
0X0
100
111
93  
94 # add debugging info
95 574 ▶ if (!$same_sql) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($same_sql) 0 574 574
96 0 _sql_differ_diag($sql1, $sql2);
97 }
98 574 ▶ if (!$same_bind) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($same_bind) 0 574 574
99 0 _bind_differ_diag($bind_ref1, $bind_ref2);
100 }
101  
102 # pass ok() result further
103 574 return $ret;
104 }
105  
106 48 ▶sub is_same_sql {
Subroutine is_same_sql: called CC=3 SCAR=12.0
Pod documented
107 48 my ($sql1, $sql2, $msg) = @_;
108  
109 # compare
110 48 my $same_sql = eq_sql($sql1, $sql2);
111  
112 # call Test::Builder::ok
113 48 ▶ my $tb = $tb || __PACKAGE__->builder;
Condition33%1/3
$SQL::Abstract::Test::tb || __PACKAGE__->builder
l!l&&r!l&&!r
0480
MC/DC0%0/2
$SQL::Abstract::Test::tb || __PACKAGE__->builder
$SQL::Abstract::Test::tb __PACKAGE__->builder
Truth table33%1/3
A || B
A= $SQL::Abstract::Test::tbB= __PACKAGE__->builder
ABresult
1X1
011
000
114 48 my $ret = $tb->ok($same_sql, $msg);
115  
116 # add debugging info
117 48 ▶ if (!$same_sql) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($same_sql) 0 48 48
118 0 _sql_differ_diag($sql1, $sql2);
119 }
120  
121 # pass ok() result further
122 48 return $ret;
123 }
124  
125 1 ▶sub is_same_bind {
Subroutine is_same_bind: called CC=3 SCAR=12.0
Pod documented
126 1 my ($bind_ref1, $bind_ref2, $msg) = @_;
127  
128 # compare
129 1 my $same_bind = eq_bind($bind_ref1, $bind_ref2);
130  
131 # call Test::Builder::ok
132 1 ▶ my $tb = $tb || __PACKAGE__->builder;
Condition33%1/3
$SQL::Abstract::Test::tb || __PACKAGE__->builder
l!l&&r!l&&!r
010
MC/DC0%0/2
$SQL::Abstract::Test::tb || __PACKAGE__->builder
$SQL::Abstract::Test::tb __PACKAGE__->builder
Truth table33%1/3
A || B
A= $SQL::Abstract::Test::tbB= __PACKAGE__->builder
ABresult
1X1
011
000
133 1 my $ret = $tb->ok($same_bind, $msg);
134  
135 # add debugging info
136 1 ▶ if (!$same_bind) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($same_bind) 0 1 1
137 0 _bind_differ_diag($bind_ref1, $bind_ref2);
138 }
139  
140 # pass ok() result further
141 1 return $ret;
142 }
143  
144 0 ▶sub dumper {
Subroutine dumper: not called CC=1 SCAR=6.9
Pod undocumented
145 # FIXME
146 # if we save the instance, we will end up with $VARx references
147 # no time to figure out how to avoid this (Deepcopy is *not* an option)
148 0 require Data::Dumper;
149 0 Data::Dumper->new([])->Terse(1)->Indent(1)->Useqq(1)->Deparse(1)->Quotekeys(0)->Sortkeys(1)->Maxdepth(0)
150 ->Values([@_])->Dump;
151 }
152  
153 0 ▶sub diag_where{
Subroutine diag_where: not called CC=2 SCAR=17.9
Pod undocumented
154 0 ▶ my $tb = $tb || __PACKAGE__->builder;
Condition0%0/3
$SQL::Abstract::Test::tb || __PACKAGE__->builder
l!l&&r!l&&!r
000
MC/DC0%0/2
$SQL::Abstract::Test::tb || __PACKAGE__->builder
$SQL::Abstract::Test::tb __PACKAGE__->builder
Truth table0%0/3
A || B
A= $SQL::Abstract::Test::tbB= __PACKAGE__->builder
ABresult
1X1
011
000
155 0 $tb->diag("Search term:\n" . &dumper);
156 }
157  
158 0 ▶sub _sql_differ_diag {
Subroutine _sql_differ_diag: not called CC=7 SCAR=40.3
159 0 ▶ my $sql1 = shift || '';
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
160 0 ▶ my $sql2 = shift || '';
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
161  
162 0 ▶ my $tb = $tb || __PACKAGE__->builder;
Condition0%0/3
$SQL::Abstract::Test::tb || __PACKAGE__->builder
l!l&&r!l&&!r
000
MC/DC0%0/2
$SQL::Abstract::Test::tb || __PACKAGE__->builder
$SQL::Abstract::Test::tb __PACKAGE__->builder
Truth table0%0/3
A || B
A= $SQL::Abstract::Test::tbB= __PACKAGE__->builder
ABresult
1X1
011
000
163  
164 0 ▶ if (my $profile = $ENV{SQL_ABSTRACT_TEST_TREE_PROFILE}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $profile = $ENV{"SQL_ABSTRACT_TEST_TREE_PROFILE"}) 0 0 0
165 0 my $sqlat = SQL::Abstract::Tree->new(profile => $profile);
166 0 $_ = $sqlat->format($_) for ($sql1, $sql2);
167 }
168  
169 0 ▶ $tb->${\($tb->in_todo ? 'note' : 'diag')} (
Branch: 1 branch
BranchTrueFalseTotal
$tb->in_todo ? : 0 0 0
170 "SQL expressions differ\n"
171 ." got: $sql1\n"
172 ."want: $sql2\n"
173 ."\nmismatch around\n$sql_differ\n"
174 );
175 }
176  
177 0 ▶sub _bind_differ_diag {
Subroutine _bind_differ_diag: not called CC=3 SCAR=24.8
178 0 my ($bind_ref1, $bind_ref2) = @_;
179  
180 0 ▶ my $tb = $tb || __PACKAGE__->builder;
Condition0%0/3
$SQL::Abstract::Test::tb || __PACKAGE__->builder
l!l&&r!l&&!r
000
MC/DC0%0/2
$SQL::Abstract::Test::tb || __PACKAGE__->builder
$SQL::Abstract::Test::tb __PACKAGE__->builder
Truth table0%0/3
A || B
A= $SQL::Abstract::Test::tbB= __PACKAGE__->builder
ABresult
1X1
011
000
181 0 ▶ $tb->${\($tb->in_todo ? 'note' : 'diag')} (
Branch: 1 branch
BranchTrueFalseTotal
$tb->in_todo ? : 0 0 0
182 "BIND values differ " . dumper({ got => $bind_ref1, want => $bind_ref2 })
183 );
184 }
185  
186 4 ▶sub eq_sql_bind {
Subroutine eq_sql_bind: called CC=2 SCAR=6.9
Pod documented
187 4 my ($sql1, $bind_ref1, $sql2, $bind_ref2) = &_unpack_arrayrefref;
188  
189 4 ▶ return eq_sql($sql1, $sql2) && eq_bind($bind_ref1, $bind_ref2);
Condition100%3/3
eq_sql($sql1, $sql2) && eq_bind($bind_ref1, $bind_ref2)
!ll&&!rl&&r
112
MC/DC100%2/2
eq_sql($sql1, $sql2) && eq_bind($bind_ref1, $bind_ref2)
eq_sql($sql1, $sql2) eq_bind($bind_ref1, $bind_ref2)
Truth table100%3/3
A && B
A= eq_sql($sql1, $sql2)B= eq_bind($bind_ref1, $bind_ref2)
ABresult
0X0
100
111
190 }
191  
192  
193 707 ▶sub eq_bind { goto &Test::Deep::eq_deeply };
Subroutine eq_bind: called CC=1 SCAR=0.0
Pod documented
194  
195 2264 ▶sub eq_sql {
Subroutine eq_sql: called CC=2 SCAR=6.9
Pod documented
196 2264 my ($sql1, $sql2) = @_;
197  
198 # parse
199 2264 my $tree1 = $sqlat->parse($sql1);
200 2264 my $tree2 = $sqlat->parse($sql2);
201  
202 2264 undef $sql_differ;
203 2264 ▶ return 1 if _eq_sql($tree1, $tree2);
Branch: 1 branch
BranchTrueFalseTotal
if _eq_sql($tree1, $tree2) 991 1273 2264
204 }
205  
206 40990 ▶sub _eq_sql {
Subroutine _eq_sql: called CC=31 SCAR=35.2
207 40990 my ($left, $right) = @_;
208  
209 # one is defined the other not
210 40990 ▶ if ((defined $left) xor (defined $right)) {
Branch: 3 branches
BranchTrueFalseTotal
if (defined $left xor defined $right) { } 21 40969 40990
elsif (not defined $left) { } 1115 39854 40969
elsif (@$left == 0 and @$right == 0) { } 22 79663 79685
Condition100%4/4
defined $left xor defined $right
l&&rl&&!r!l&&r!l&&!r
398549121115
MC/DC100%2/2
defined $left xor defined $right
defined $left defined $right
Truth table100%4/4
A xor B
A= defined $leftB= defined $right
ABresult
110
101
011
000
211 21 ▶ $sql_differ = sprintf ("[%s] != [%s]\n", map { defined $_ ? $sqlat->unparse($_) : 'N/A' } ($left, $right) );
Branch: 1 branch
BranchTrueFalseTotal
defined $_ ? : 21 21 42
212 21 return 0;
213 }
214  
215 # one is undefined, then so is the other
216 elsif (not defined $left) {
217 1115 return 1;
218 }
219  
220 # both are empty
221 ▶ elsif (@$left == 0 and @$right == 0) {
Condition100%3/3
@$left == 0 and @$right == 0
!ll&&!rl&&r
39831122
MC/DC100%2/2
@$left == 0 and @$right == 0
@$left == 0 @$right == 0
Truth table100%3/3
A and B
A= @$left == 0B= @$right == 0
ABresult
0X0
100
111
222 22 return 1;
223 }
224  
225 # one is empty
226 39832 ▶ if (@$left == 0 or @$right == 0) {
Branch: 3 branches
BranchTrueFalseTotal
if (@$left == 0 or @$right == 0) { } 9 39823 39832
elsif (ref $left->[0] xor ref $right->[0]) { } 0 39823 39823
elsif (ref $left->[0]) { } 14864 24959 39823
Condition100%3/3
@$left == 0 or @$right == 0
l!l&&r!l&&!r
1839823
MC/DC100%2/2
@$left == 0 or @$right == 0
@$left == 0 @$right == 0
Truth table100%3/3
A or B
A= @$left == 0B= @$right == 0
ABresult
1X1
011
000
227 9 ▶ $sql_differ = sprintf ("left: %s\nright: %s\n", map { @$_ ? $sqlat->unparse($_) : 'N/A'} ($left, $right) );
Branch: 1 branch
BranchTrueFalseTotal
@$_ ? : 9 9 18
228 9 return 0;
229 }
230  
231 # one is a list, the other is an op with a list
232 ▶ elsif (ref $left->[0] xor ref $right->[0]) {
Condition50%2/4
ref $left->[0] xor ref $right->[0]
l&&rl&&!r!l&&r!l&&!r
148640024959
MC/DC0%0/2
ref $left->[0] xor ref $right->[0]
ref $left->[0] ref $right->[0]
Truth table50%2/4
A xor B
A= ref $left->[0]B= ref $right->[0]
ABresult
110
101
011
000
233 $sql_differ = sprintf ("[%s] != [%s]\nleft: %s\nright: %s\n", map
234 0 ▶ { ref $_ ? $sqlat->unparse($_) : $_ }
Branch: 1 branch
BranchTrueFalseTotal
ref $_ ? : 0 0 0
235 ($left->[0], $right->[0], $left, $right)
236 );
237 0 return 0;
238 }
239  
240 # both are lists
241 elsif (ref $left->[0]) {
242 14864 ▶ for (my $i = 0; $i <= $#$left or $i <= $#$right; $i++ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $left->$#* or $i <= $right->$#*) 23871 10516 34387
Condition100%3/3
$i <= $left->$#* or $i <= $right->$#*
l!l&&r!l&&!r
238591210516
MC/DC100%2/2
$i <= $left->$#* or $i <= $right->$#*
$i <= $left->$#* $i <= $right->$#*
Truth table100%3/3
A or B
A= $i <= $left->$#*B= $i <= $right->$#*
ABresult
1X1
011
000
243 23871 ▶ if (not _eq_sql ($left->[$i], $right->[$i]) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (_eq_sql($left->[$i], $right->[$i])) 4348 19523 23871
244 4348 ▶ if (! $sql_differ or $sql_differ !~ /left\:\s .+ right:\s/xs) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($SQL::Abstract::Test::sql_differ and $SQL::Abstract::Test::sql_differ =~ /left\:\s .+ right:\s/sx) 886 3462 4348
Condition66%2/3
$SQL::Abstract::Test::sql_differ and $SQL::Abstract::Test::sql_differ =~ /left\:\s .+ right:\s/sx
!ll&&!rl&&r
08863462
MC/DC50%1/2
$SQL::Abstract::Test::sql_differ and $SQL::Abstract::Test::sql_differ =~ /left\:\s .+ right:\s/sx
$SQL::Abstract::Test::sql_differ $SQL::Abstract::Test::sql_differ =~ /left\:\s .+ right:\s/sx
Truth table66%2/3
A and B
A= $SQL::Abstract::Test::sql_differB= $SQL::Abstract::Test::sql_differ =~ /left\:\s .+ right:\s/sx
ABresult
0X0
100
111
245 886 ▶ $sql_differ ||= '';
Condition50%1/2
$SQL::Abstract::Test::sql_differ ||= ""
l!l
8860
MC/DC0%0/1
$SQL::Abstract::Test::sql_differ ||= ""
$SQL::Abstract::Test::sql_differ
Truth table50%1/2
A
A= $SQL::Abstract::Test::sql_differ
Aresult
11
00
246 886 ▶ $sql_differ .= "\n" unless $sql_differ =~ /\n\z/;
Branch: 1 branch
BranchTrueFalseTotal
unless $SQL::Abstract::Test::sql_differ =~ /\n\z/ 0 886 886
247 886 $sql_differ .= sprintf ("left: %s\nright: %s\n", map { $sqlat->unparse($_) } ($left, $right) );
248 }
249 4348 return 0;
250 }
251 }
252 10516 return 1;
253 }
254  
255 # both are ops
256 else {
257  
258 # unroll parenthesis if possible/allowed
259 24959 ▶ unless ($parenthesis_significant) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($SQL::Abstract::Test::parenthesis_significant) 24702 257 24959
260 24702 $sqlat->_parenthesis_unroll($_) for $left, $right;
261 }
262  
263 # unroll ASC order by's
264 24959 ▶ unless ($order_by_asc_significant) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($SQL::Abstract::Test::order_by_asc_significant) 24941 18 24959
265 24941 $sqlat->_strip_asc_from_order_by($_) for $left, $right;
266 }
267  
268 24959 ▶ if ($left->[0] ne $right->[0]) {
Branch: 2 branches
BranchTrueFalseTotal
if ($left->[0] ne $right->[0]) { } 378 24581 24959
elsif ($left->[0] eq '-LITERAL') { } 9726 14855 24581
269 378 $sql_differ = sprintf "OP [$left->[0]] != [$right->[0]] in\nleft: %s\nright: %s\n",
270 $sqlat->unparse($left),
271 $sqlat->unparse($right)
272 ;
273 378 return 0;
274 }
275  
276 # literals have a different arg-sig
277 elsif ($left->[0] eq '-LITERAL') {
278 9726 (my $l = " $left->[1][0] " ) =~ s/\s+/ /g;
279 9726 (my $r = " $right->[1][0] ") =~ s/\s+/ /g;
280 9726 ▶ my $eq = $case_sensitive ? $l eq $r : uc($l) eq uc($r);
Branch: 1 branch
BranchTrueFalseTotal
$SQL::Abstract::Test::case_sensitive ? : 0 9726 9726
281 9726 ▶ $sql_differ = "[$l] != [$r]\n" if not $eq;
Branch: 1 branch
BranchTrueFalseTotal
unless $eq 865 8861 9726
282 9726 return $eq;
283 }
284  
285 # if operators are identical, compare operands
286 else {
287 14855 my $eq = _eq_sql($left->[1], $right->[1]);
288 0 ▶ $sql_differ ||= sprintf ("left: %s\nright: %s\n", map { $sqlat->unparse($_) } ($left, $right) ) if not $eq;
Branch: 1 branch
BranchTrueFalseTotal
unless $eq 3075 11780 14855
Condition33%1/3
$SQL::Abstract::Test::sql_differ ||= sprintf("left: %s\nright: %s\n", map({$sqlat->unparse($_);} $left, $right))
l!l&&r!l&&!r
307500
MC/DC0%0/2
$SQL::Abstract::Test::sql_differ ||= sprintf("left: %s\nright: %s\n", map({$sqlat->unparse($_);} $left, $right))
$SQL::Abstract::Test::sql_differ sprintf("left: %s\nright: %s\n", map({$sqlat->unparse($_);} $left, $right))
Truth table33%1/3
A ||= B
A= $SQL::Abstract::Test::sql_differB= sprintf("left: %s\nright: %s\n", map({$sqlat->unparse($_);} $left, $right))
ABresult
1X1
011
000
289 14855 return $eq;
290 }
291 }
292 }
293  
294 0 ▶sub parse { $sqlat->parse(@_) }
Subroutine parse: not called CC=1 SCAR=6.9
Pod undocumented
295 16 1;
296  
297  
298 __END__
« SQL/Abstract.pm ↑ Summary SQL/Abstract/Plugin/BangOverrides.pm »