Fix idiocy that snuck in bdbd2ae8a - I only want fatal undefs
[dbsrgits/DBIx-Class.git] / t / resultset / find_on_subquery_cond.t
CommitLineData
76cc4546 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Exception;
6
7use lib qw(t/lib);
8use DBICTest;
9
10my $schema = DBICTest->init_schema();
11my $rs = $schema->resultset('Artist');
12
13for 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
23for 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
34done_testing;