my $same_sql = eq_sql($tree1, $tree2);
my $same_bind = eq_bind($bind_ref1, $bind_ref2);
- # call Test::More::ok
+ # call Test::Builder::ok
$tb->ok($same_sql && $same_bind, $msg);
# add debugging info
# some bind values can be arrayrefs (see L<SQL::Abstract/bindtype>),
# so stringify them.
- my @strings = map {ref $_ eq 'ARRAY' ? join('=>', @$_) : ($_ || '')}
- @$bind_ref;
+ # furthermore, if L<SQL::Abstract/array_datatypes> is set to true, elements
+ # of those arrayrefs can be arrayrefs, too.
+ my @strings = map {
+ ref $_ eq 'ARRAY'
+ ? join('=>', map {
+ ref $_ eq 'ARRAY'
+ ? ('[' . join('=>', @$_) . ']')
+ : (defined $_ ? $_ : '')
+ } @$_)
+ : (defined $_ ? $_ : '')
+ } @$bind_ref;
# join all values into a single string
return join "///", @strings;
$expected_sql, \@expected_bind, $test_msg);
Compares given and expected pairs of C<($sql, \@bind)>, and calls
-L<Test::More/ok> on the result, with C<$test_msg> as message. If the
+L<Test::Builder/ok> on the result, with C<$test_msg> as message. If the
test fails, a detailed diagnostic is printed. For clients which use
-L<Test::More|Test::More>, this is the only function that needs to be
+L<Test::Build>, this is the only function that needs to be
imported.
=head2 eq_sql
=head1 SEE ALSO
-L<SQL::Abstract>, L<Test::More>.
+L<SQL::Abstract>, L<Test::More>, L<Test::Builder>.
=head1 AUTHOR