From: Rafael Kitover Date: Thu, 4 Jun 2009 23:02:48 +0000 (+0000) Subject: test sybase group_by count, works X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=92e7a79b6c2fcc4ea7c77a8edbddc46d8067f508;p=dbsrgits%2FDBIx-Class-Historic.git test sybase group_by count, works --- diff --git a/t/746sybase.t b/t/746sybase.t index aa6f4a9..5bc5ec8 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -11,7 +11,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/} plan skip_all => 'Set $ENV{DBICTEST_SYBASE_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => (17 + 4*2)*2; +plan tests => (18 + 4*2)*2; my @storage_types = ( 'DBI::Sybase', @@ -95,6 +95,16 @@ SQL is( $it->next->name, "Artist 5", "iterator->next ok" ); is( $it->next, undef, "next past end of resultset ok" ); +# now try a grouped count + $schema->resultset('Artist')->create({ name => 'Artist 6' }) + for (1..6); + + $it = $schema->resultset('Artist')->search({}, { + group_by => 'name' + }); + + is( $it->count, 7, 'COUNT of GROUP_BY ok' ); + SKIP: { skip 'quoting bug with NoBindVars', 4*2 if $storage_type eq 'DBI::Sybase::NoBindVars';