[Bast-commits] r5742 - DBIx-Class/0.08/branches/subquery/t/search

michaelr at dev.catalyst.perl.org michaelr at dev.catalyst.perl.org
Thu Mar 12 18:17:03 GMT 2009


Author: michaelr
Date: 2009-03-12 18:17:03 +0000 (Thu, 12 Mar 2009)
New Revision: 5742

Modified:
   DBIx-Class/0.08/branches/subquery/t/search/subquery.t
Log:
added failing from => rs->as_query test



Modified: DBIx-Class/0.08/branches/subquery/t/search/subquery.t
===================================================================
--- DBIx-Class/0.08/branches/subquery/t/search/subquery.t	2009-03-12 15:34:01 UTC (rev 5741)
+++ DBIx-Class/0.08/branches/subquery/t/search/subquery.t	2009-03-12 18:17:03 UTC (rev 5742)
@@ -11,7 +11,7 @@
     eval "use SQL::Abstract 1.49";
     plan $@
         ? ( skip_all => "Needs SQLA 1.49+" )
-        : ( tests => 7 );
+        : ( tests => 8 );
 }
 
 use lib qw(t/lib);
@@ -167,4 +167,24 @@
   );
 }
 
+{
+  my $rs = $cdrs->search(
+    {},
+    {
+      alias => 'cd2',
+      from => [
+        { cd2 => $cdrs->search({ title => 'Thriller' })->as_query },
+      ],
+    },
+  );
+
+  my $arr = $rs->as_query;
+  my ($query, @bind) = @{$$arr};
+  is_same_sql_bind(
+    $query, \@bind,
+    "SELECT cd2.cdid, cd2.artist, cd2.title, cd2.year, cd2.genreid, cd2.single_track FROM (SELECT me.cdid,me.artist,me.title,me.year,me.genreid,me.single_track FROM cd me WHERE title = 'Thriller') cd2",
+    [],
+  );
+}
+
 __END__




More information about the Bast-commits mailing list