6 use lib '/sporkrw/xfer/DBIx-Class/0.08/branches/count_distinct/lib';
9 my $schema = DBICTest->init_schema();
11 eval "use DBD::SQLite";
12 plan skip_all => 'needs DBD::SQLite for testing' if $@;
15 cmp_ok($schema->resultset("Tag")->count({ tag => 'Blue' }),
16 '==', 9, 'Count without DISTINCT ok');
18 cmp_ok($schema->resultset("Tag")->count({ tag => [ 'Blue', 'Shiny' ] }, { group_by => 'tag' }),
19 '==', 2, 'Count with single column group_by ok');
21 cmp_ok($schema->resultset("Tag")->count({ tag => 'Blue' }, { group_by => [ qw/tag cd/ ]}),
22 '==', 4, 'Count with multiple column group_by ok');
24 cmp_ok($schema->resultset("Tag")->count({ tag => 'Blue' }, { distinct => 1 }),
25 '==', 4, "Count with single column distinct ok");