Yeah, committing the new tests would help ...
[dbsrgits/DBIx-Class.git] / t / run / 17join_count.tl
CommitLineData
0567538f 1sub run_tests {
2
3eval "use DBD::SQLite";
4plan skip_all => 'needs DBD::SQLite for testing' if $@;
5plan tests => 4;
6
7cmp_ok(DBICTest::CD->count({ 'artist.name' => 'Caterwauler McCrae' },
8 { join => 'artist' }),
9 '==', 3, 'Count by has_a ok');
10
11cmp_ok(DBICTest::CD->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }),
12 '==', 4, 'Count by has_many ok');
13
14cmp_ok(DBICTest::CD->count(
15 { 'liner_notes.notes' => { '!=' => undef } },
16 { join => 'liner_notes' }),
17 '==', 3, 'Count by might_have ok');
18
19cmp_ok(DBICTest::CD->count(
20 { 'year' => { '>', 1998 }, 'tags.tag' => 'Cheesy',
21 'liner_notes.notes' => { 'like' => 'Buy%' } },
22 { join => [ qw/tags liner_notes/ ] } ),
23 '==', 2, "Mixed count ok");
24
25}
26
271;