[Bast-commits] r6343 - DBIx-Class/0.08/trunk/t/count
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed May 20 03:58:36 GMT 2009
Author: caelum
Date: 2009-05-20 03:58:36 +0000 (Wed, 20 May 2009)
New Revision: 6343
Modified:
DBIx-Class/0.08/trunk/t/count/distinct.t
Log:
add test for distinct result of sql function
Modified: DBIx-Class/0.08/trunk/t/count/distinct.t
===================================================================
--- DBIx-Class/0.08/trunk/t/count/distinct.t 2009-05-20 03:11:12 UTC (rev 6342)
+++ DBIx-Class/0.08/trunk/t/count/distinct.t 2009-05-20 03:58:36 UTC (rev 6343)
@@ -13,7 +13,7 @@
eval "use DBD::SQLite";
plan skip_all => 'needs DBD::SQLite for testing' if $@;
-plan tests => 18;
+plan tests => 19;
# The tag Blue is assigned to cds 1 2 3 and 5
# The tag Cheesy is assigned to cds 2 4 and 5
@@ -71,6 +71,12 @@
$rs = $schema->resultset('Tag')->search({ tag => \" IN ('Blue', 'Cheesy')" }, { group_by => [ qw/tag cd/ ] });
is($rs->count, 7, 'Count with literal SQL and multiple group_by');
+$rs = $schema->resultset('Tag')->search({}, {
+ select => { length => 'tag' },
+ distinct => 1
+});
+is($rs->count, 3, 'Count by distinc result of function');
+
my @warnings;
{
local $SIG{__WARN__} = sub { push @warnings, shift };
More information about the Bast-commits
mailing list