* Replaced eq_bind() implementation to use Test::Deep::eq_deeply().
[dbsrgits/DBIx-Class.git] / t / lib / DBIC / SqlMakerTest.pm
index 0dce0d1..0ab8939 100644 (file)
@@ -7,7 +7,6 @@ use warnings;
 use base qw/Test::Builder::Module Exporter/;
 
 use Exporter;
-use Data::Dumper;
 
 our @EXPORT = qw/
   &is_same_sql_bind
@@ -27,7 +26,10 @@ our @EXPORT = qw/
 
   use base qw/Test::Builder::Module Exporter/;
 
+  use Scalar::Util qw(looks_like_number blessed reftype);
   use Data::Dumper;
+  use Test::Builder;
+  use Test::Deep qw(eq_deeply);
 
   our $tb = __PACKAGE__->builder;
 
@@ -64,26 +66,12 @@ our @EXPORT = qw/
     return $left eq $right;
   }
 
+  # lifted from SQL::Abstract::Test
   sub eq_bind
   {
     my ($bind_ref1, $bind_ref2) = @_;
 
-    return stringify_bind($bind_ref1) eq stringify_bind($bind_ref2);
-  }
-
-  sub stringify_bind
-  {
-    my ($bind) = @_;
-
-    foreach (ref $bind) {
-      /^$/ and return $bind;
-      /^ARRAY$/ and return join("\n", map { stringify_bind($_) } @$bind);
-      /^HASH$/ and return join(
-        "\n", map { $_ . " => " . stringify_bind($bind->{$_}) } keys %$bind
-      );
-      /^SCALAR$/ and return "\\" . stringify_bind($$bind);
-      return '' . $bind;
-    }
+    return eq_deeply($bind_ref1, $bind_ref2);
   }
 }