Merge branch 'master' into topic/constructor_rewrite
[dbsrgits/DBIx-Class.git] / t / count / distinct.t
index b93f9ad..1ef8ccf 100644 (file)
@@ -1,5 +1,5 @@
 use strict;
-use warnings;  
+use warnings;
 
 use Test::More;
 use Test::Exception;
@@ -47,7 +47,7 @@ for my $get_count (
   $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->get_column('tag')->as_query } }, { distinct => 1 });
   is($get_count->($rs), 7, 'Count with IN subquery with outside distinct');
 
-  $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->get_column('tag')->as_query } }, { distinct => 1, select => 'tag' }), 
+  $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->get_column('tag')->as_query } }, { distinct => 1, select => 'tag' }),
   is($get_count->($rs), 2, 'Count with IN subquery with outside distinct on a single column');
 
   $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->search({}, { group_by => 'tag' })->get_column('tag')->as_query } });
@@ -74,7 +74,7 @@ for my $get_count (
   $rs = $schema->resultset('Tag')->search({ tag => 'Blue' }, { '+select' => { max => 'tagid' }, distinct => 1 });
   is($get_count->($rs), 4, 'Count with +select aggreggate');
 
-  $rs = $schema->resultset('Tag')->search({}, { select => 'length(me.tag)', distinct => 1 });
+  $rs = $schema->resultset('Tag')->search({}, { select => [\'length(me.tag)'], distinct => 1 });
   is($get_count->($rs), 3, 'Count by distinct function result as select literal');
 }