Final count tests
[dbsrgits/DBIx-Class-Historic.git] / t / resultset / as_query.t
index 5071f0c..f3a09fc 100644 (file)
@@ -7,12 +7,7 @@ use Data::Dumper;
 
 use Test::More;
 
-BEGIN {
-    eval "use SQL::Abstract 1.49";
-    plan $@
-        ? ( skip_all => "Needs SQLA 1.49+" )
-        : ( tests => 4 );
-}
+plan ( tests => 5 );
 
 use lib qw(t/lib);
 use DBICTest;
@@ -71,4 +66,11 @@ my $rscol = $art_rs->get_column( 'charfield' );
   );
 }
 
-__END__
+{
+  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');
+}