X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=t%2Frun%2F28result_set_column.tl;h=8898878809aeea646b2f092ca1f20ef196b36e26;hp=e62cb62585fa5fc48fdc05df7f7e4dcc697d1db0;hb=cec1396380c77f0001a687879dc77377df4371ab;hpb=9d29cf57a7ed1b68277ff2b7ee58d46112d8c384 diff --git a/t/run/28result_set_column.tl b/t/run/28result_set_column.tl index e62cb62..8898878 100644 --- a/t/run/28result_set_column.tl +++ b/t/run/28result_set_column.tl @@ -1,7 +1,7 @@ sub run_tests { my $schema = shift; -plan tests => 5; +plan tests => 8; my $rs = $cd = $schema->resultset("CD")->search({}); @@ -18,6 +18,22 @@ is($rs_title->min, 'Caterwaulin\' Blues', "min okay for title"); cmp_ok($rs_year->sum, '==', 9996, "three artists returned"); +my $psrs = $schema->resultset('CD')->search({}, + { + '+select' => \'COUNT(*)', + '+as' => 'count' + } +); +ok(defined($psrs->get_column('count')), '+select/+as count'); + +$psrs = $schema->resultset('CD')->search({}, + { + '+select' => [ \'COUNT(*)', 'title' ], + '+as' => [ 'count', 'addedtitle' ] + } +); +ok(defined($psrs->get_column('count')), '+select/+as arrayref count'); +ok(defined($psrs->get_column('addedtitle')), '+select/+as title'); } 1;