1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Test::Deep;
use TestSchema;
my $schema = TestSchema->deploy_or_connect();
$schema->prepopulate;
my $rs = $schema->resultset('Foo');
cmp_deeply
[$rs->prefetch('bar')->all],
[$rs->search(undef,{prefetch => 'bar' })->all],
'prefetch works the same with scalar';
cmp_deeply
[$rs->prefetch(['bar','bars'])->all],
[$rs->search(undef,{prefetch => ['bar','bars'] })->all],
'prefetch works the same with arrayref';
cmp_deeply
[$rs->prefetch('bar','bars')->all],
[$rs->search(undef,{prefetch => ['bar','bars'] })->all],
'prefetch works the same with list';
done_testing;
|