TODOify sqla-dependent tests
[dbsrgits/DBIx-Class.git] / t / resultset / as_query.t
index b573606..6865655 100644 (file)
@@ -6,12 +6,13 @@ use warnings FATAL => 'all';
 use Data::Dumper;
 
 use Test::More;
+
+plan ( tests => 5 );
+
 use lib qw(t/lib);
 use DBICTest;
 use DBIC::SqlMakerTest;
 
-plan tests => 4;
-
 my $schema = DBICTest->init_schema();
 my $art_rs = $schema->resultset('Artist');
 my $cdrs = $schema->resultset('CD');
@@ -65,4 +66,14 @@ my $rscol = $art_rs->get_column( 'charfield' );
   );
 }
 
+TODO: {
+    local $TODO = 'Needs -paren fixes in SQLA before it can work';
+    my $rs = $schema->resultset("CD")->search(
+        { 'artist.name' => 'Caterwauler McCrae' },
+        { join => [qw/artist/]}
+    );
+    my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $rs->get_column('cdid')->as_query } } );
+    cmp_ok($subsel_rs->count, '==', $rs->count, 'Subselect on PK got the same row count');
+}
+
 __END__