Cleanup shebang lines of all maint/example scripts, remove from tests entirely
[dbsrgits/DBIx-Class.git] / t / count / in_subquery.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 use lib qw(t/lib);
7 use DBICTest;
8 use DBIC::SqlMakerTest;
9
10 my $schema = DBICTest->init_schema();
11
12 {
13     my $rs = $schema->resultset("CD")->search(
14         { 'artist.name' => 'Caterwauler McCrae' },
15         { join => [qw/artist/]}
16     );
17     my $squery = $rs->get_column('cdid')->as_query;
18     my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $squery } } );
19     is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
20 }
21
22 done_testing;