[Bast-commits] r5219 - in DBIx-Class/0.08/branches/sqla_1.50_compat: . t/lib/DBIC

norbi at dev.catalyst.perl.org norbi at dev.catalyst.perl.org
Fri Nov 28 08:43:49 GMT 2008


Author: norbi
Date: 2008-11-28 08:43:48 +0000 (Fri, 28 Nov 2008)
New Revision: 5219

Modified:
   DBIx-Class/0.08/branches/sqla_1.50_compat/
   DBIx-Class/0.08/branches/sqla_1.50_compat/Makefile.PL
   DBIx-Class/0.08/branches/sqla_1.50_compat/t/lib/DBIC/SqlMakerTest.pm
Log:
 r5287 at vger:  mendel | 2008-11-28 09:43:36 +0100
  * Replaced eq_bind() implementation to use Test::Deep::eq_deeply().



Property changes on: DBIx-Class/0.08/branches/sqla_1.50_compat
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/sqla_1.50_compat:5281
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd5ac9a7-f185-4d95-9186-dbb8b392a572:/local/os/bast/DBIx-Class/0.08/trunk:2798
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/complex_join_rels:4589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/parser_fk_index:4485
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioning:4578
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:5113
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/DBIx-Class/0.08/branches/sqla_1.50_compat:5287
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd5ac9a7-f185-4d95-9186-dbb8b392a572:/local/os/bast/DBIx-Class/0.08/trunk:2798
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/complex_join_rels:4589
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/parser_fk_index:4485
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/replication_dedux:4600
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioning:4578
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:5113
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510

Modified: DBIx-Class/0.08/branches/sqla_1.50_compat/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/sqla_1.50_compat/Makefile.PL	2008-11-28 08:30:09 UTC (rev 5218)
+++ DBIx-Class/0.08/branches/sqla_1.50_compat/Makefile.PL	2008-11-28 08:43:48 UTC (rev 5219)
@@ -33,6 +33,7 @@
 test_requires 'Test::Builder'       => 0.33;
 test_requires 'Test::Warn'          => 0.11;
 test_requires 'Test::Exception'     => 0;
+test_requires 'Test::Deep'          => 0;
 
 install_script 'script/dbicadmin';
 

Modified: DBIx-Class/0.08/branches/sqla_1.50_compat/t/lib/DBIC/SqlMakerTest.pm
===================================================================
--- DBIx-Class/0.08/branches/sqla_1.50_compat/t/lib/DBIC/SqlMakerTest.pm	2008-11-28 08:30:09 UTC (rev 5218)
+++ DBIx-Class/0.08/branches/sqla_1.50_compat/t/lib/DBIC/SqlMakerTest.pm	2008-11-28 08:43:48 UTC (rev 5219)
@@ -28,6 +28,8 @@
 
   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;
 
@@ -69,58 +71,7 @@
   {
     my ($bind_ref1, $bind_ref2) = @_;
 
-    my $ref1 = ref $bind_ref1;
-    my $ref2 = ref $bind_ref2;
-
-    return 0 if $ref1 ne $ref2;
-
-    if ($ref1 eq 'SCALAR' || $ref1 eq 'REF') {
-      return eq_bind($$bind_ref1, $$bind_ref2);
-    } elsif ($ref1 eq 'ARRAY') {
-      return 0 if scalar @$bind_ref1 != scalar @$bind_ref2;
-      for (my $i = 0; $i < @$bind_ref1; $i++) {
-        return 0 if !eq_bind($bind_ref1->[$i], $bind_ref2->[$i]);
-      }
-      return 1;
-    } elsif ($ref1 eq 'HASH') {
-        return
-          eq_bind(
-            [sort keys %$bind_ref1],
-            [sort keys %$bind_ref2]
-          )
-          && eq_bind(
-            [map { $bind_ref1->{$_} } sort keys %$bind_ref1],
-            [map { $bind_ref2->{$_} } sort keys %$bind_ref2]
-          );
-    } else {
-      if (!defined $bind_ref1 || !defined $bind_ref2) {
-        return !(defined $bind_ref1 ^ defined $bind_ref2);
-      } elsif (blessed($bind_ref1) || blessed($bind_ref2)) {
-        return 0 if (blessed($bind_ref1) || "") ne (blessed($bind_ref2) || "");
-        return 1 if $bind_ref1 == $bind_ref2;  # uses overloaded '=='
-        # fallback: compare the guts of the object
-        my $reftype1 = reftype $bind_ref1;
-        my $reftype2 = reftype $bind_ref2;
-        return 0 if $reftype1 ne $reftype2;
-        if ($reftype1 eq 'SCALAR' || $reftype1 eq 'REF') {
-          $bind_ref1 = $$bind_ref1;
-          $bind_ref2 = $$bind_ref2;
-        } elsif ($reftype1 eq 'ARRAY') {
-          $bind_ref1 = [@$bind_ref1];
-          $bind_ref2 = [@$bind_ref2]; 
-        } elsif ($reftype1 eq 'HASH') {
-          $bind_ref1 = {%$bind_ref1};
-          $bind_ref2 = {%$bind_ref2};
-        } else { 
-          return 0;
-        }
-        return eq_bind($bind_ref1, $bind_ref2); 
-      } elsif (looks_like_number($bind_ref1) && looks_like_number($bind_ref2)) {
-        return $bind_ref1 == $bind_ref2;
-      } else { 
-        return $bind_ref1 eq $bind_ref2;
-      }
-    }
+    return eq_deeply($bind_ref1, $bind_ref2);
   }
 }
 




More information about the Bast-commits mailing list