X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F88result_set_column.t;h=ef4912bfb8cf8bb0973de53722819c27abff8fb2;hb=f81b9157d27ced5e5a91c0f78e720da4cbe7d923;hp=5ed86d4ec47bc9cf1536a28097a3e808e514942f;hpb=ae51573612aec70814b81bfe0c3683b824564368;p=dbsrgits%2FDBIx-Class.git diff --git a/t/88result_set_column.t b/t/88result_set_column.t index 5ed86d4..ef4912b 100644 --- a/t/88result_set_column.t +++ b/t/88result_set_column.t @@ -5,9 +5,9 @@ use Test::More; use lib qw(t/lib); use DBICTest; -my $schema = DBICTest::init_schema(); +my $schema = DBICTest->init_schema(); -plan tests => 8; +plan tests => 10; my $cd; my $rs = $cd = $schema->resultset("CD")->search({}); @@ -17,6 +17,8 @@ my $rs_year = $rs->get_column('year'); is($rs_title->next, 'Spoonful of bees', "next okay"); +is_deeply( [ sort $rs_year->func('DISTINCT') ], [ 1997, 1998, 1999, 2001 ], "wantarray context okay"); + my @all = $rs_title->all; cmp_ok(scalar @all, '==', 5, "five titles returned"); @@ -42,3 +44,8 @@ $psrs = $schema->resultset('CD')->search({}, ok(defined($psrs->get_column('count')), '+select/+as arrayref count'); ok(defined($psrs->get_column('addedtitle')), '+select/+as title'); +{ + my $rs = $schema->resultset("CD")->search({}, { prefetch => 'artist' }); + my $rsc = $rs->get_column('year'); + is( $rsc->{_parent_resultset}->{attrs}->{prefetch}, undef, 'prefetch wiped' ); +}