Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
76cc4546 |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More; |
7 | use Test::Exception; |
8 | |
c0329273 |
9 | |
76cc4546 |
10 | use DBICTest; |
11 | |
12 | my $schema = DBICTest->init_schema(); |
13 | my $rs = $schema->resultset('Artist'); |
14 | |
15 | for 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 | |
25 | for 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 | |
36 | done_testing; |