Commit | Line | Data |
704c5138 |
1 | use strict; |
2 | use warnings; |
3 | |
cbcfedc1 |
4 | use Test::More tests => 3; |
704c5138 |
5 | use Test::Differences; |
6 | |
7 | use_ok('SQL::Abstract') or BAIL_OUT( "$@" ); |
8 | |
9 | my $sqla = SQL::Abstract->create(1); |
10 | |
11 | is $sqla->dispatch( |
cbcfedc1 |
12 | { -type => 'join', |
13 | tablespec => [-name => qw/foo/], |
14 | on => [ '==', [-name => qw/foo id/], [ -name => qw/me foo_id/ ] ], |
15 | } |
704c5138 |
16 | ), "JOIN foo ON (foo.id = me.foo_id)", |
17 | "simple join clause"; |
18 | |
cbcfedc1 |
19 | is $sqla->dispatch( |
20 | { -type => 'join', |
21 | tablespec => [-alias => [-name => qw/foo/], 'bar' ], |
22 | using => [ -name => qw/foo_id/ ] |
23 | } |
24 | ), "JOIN foo AS bar USING (foo_id)", |
25 | "using join clause"; |