Final count tests
[dbsrgits/DBIx-Class-Historic.git] / t / resultset / as_query.t
index c496085..f3a09fc 100644 (file)
@@ -7,7 +7,7 @@ use Data::Dumper;
 
 use Test::More;
 
-plan ( tests => 4 );
+plan ( tests => 5 );
 
 use lib qw(t/lib);
 use DBICTest;
@@ -65,3 +65,12 @@ my $rscol = $art_rs->get_column( 'charfield' );
     [ [ rank => 2 ], [ name => 'Billy Joel' ] ],
   );
 }
+
+{
+  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 } } );
+  is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
+}