Fix incorrect cond construction in _minimal_valueset_satisfying_constraint
[dbsrgits/DBIx-Class-Historic.git] / t / resultset / find_on_subquery_cond.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6
7 use lib qw(t/lib);
8 use DBICTest;
9
10 my $schema = DBICTest->init_schema();
11 my $rs = $schema->resultset('Artist');
12
13 for my $id (
14   2,
15   \' = 2 ',
16   \[ '= ?', 2 ],
17 ) {
18   lives_ok {
19     is( $rs->find({ artistid => $id })->id, 2 )
20   } "Correctly found artist with id of @{[ explain $id ]}";
21 }
22
23 for my $id (
24   2,
25   \'2',
26   \[ '?', 2 ],
27 ) {
28   my $cond = { artistid => { '=', $id } };
29   lives_ok {
30     is( $rs->find($cond)->id, 2 )
31   } "Correctly found artist with id of @{[ explain $cond ]}";
32 }
33
34 done_testing;