Support one more convoluted case of data-poor collapse
[dbsrgits/DBIx-Class.git] / t / resultset / find_on_subquery_cond.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
76cc4546 3use strict;
4use warnings;
5
6use Test::More;
7use Test::Exception;
8
c0329273 9
76cc4546 10use DBICTest;
11
12my $schema = DBICTest->init_schema();
13my $rs = $schema->resultset('Artist');
14
15for my $id (
16 2,
17 \' = 2 ',
18 \[ '= ?', 2 ],
19) {
20 lives_ok {
21 is( $rs->find({ artistid => $id })->id, 2 )
22 } "Correctly found artist with id of @{[ explain $id ]}";
23}
24
25for my $id (
26 2,
27 \'2',
28 \[ '?', 2 ],
29) {
30 my $cond = { artistid => { '=', $id } };
31 lives_ok {
32 is( $rs->find($cond)->id, 2 )
33 } "Correctly found artist with id of @{[ explain $cond ]}";
34}
35
36done_testing;