X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F71mysql.t;h=b51947c8427e1a7db904e73e68ced5dea7be207a;hb=efc8ae6e0e781a9c04c1d519ff8a2daa9ace5e49;hp=aa2db86e817b9d924b3efd7a3cd10c008c8db091;hpb=ca45887109be96f794fccbaedf7666f82f1073d6;p=dbsrgits%2FDBIx-Class.git diff --git a/t/71mysql.t b/t/71mysql.t index aa2db86..b51947c 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -225,6 +225,23 @@ NULLINSEARCH: { => 'Nothing Found!'; } +# check for proper grouped counts +{ + my $ansi_schema = DBICTest::Schema->connect ($dsn, $user, $pass, { on_connect_call => 'set_strict_mode' }); + my $rs = $ansi_schema->resultset('CD'); + + my $years; + $years->{$_->year|| scalar keys %$years}++ for $rs->all; # NULL != NULL, thus the keys eval + + lives_ok ( sub { + is ( + $rs->search ({}, { group_by => 'year'})->count, + scalar keys %$years, + 'grouped count correct', + ); + }, 'Grouped count does not throw'); +} + ZEROINSEARCH: { my $cds_per_year = { 2001 => 2,