Updated doc to refer to Test::Builder instead of Test::More where appropriate.
[scpubgit/Q-Branch.git] / lib / SQL / Abstract / Test.pm
index d55f3a8..55c2e99 100644 (file)
@@ -22,7 +22,7 @@ sub is_same_sql_bind {
   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
@@ -52,8 +52,17 @@ sub stringify_bind {
 
   # 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;
@@ -191,9 +200,9 @@ laws, etc.
                    $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
@@ -227,7 +236,7 @@ where a difference was encountered.
 
 =head1 SEE ALSO
 
-L<SQL::Abstract>, L<Test::More>.
+L<SQL::Abstract>, L<Test::More>, L<Test::Builder>.
 
 =head1 AUTHOR