X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F200_join.t;h=176ab81c37af9a6c021b655a6c66dd43395854c0;hb=cbcfedc1e28bc756373605ec2854dc43c31be53b;hp=2e89ebcd55a1c0d554a583eabc523bc8d54d7bb5;hpb=704c513833ed286daebbf137fa170fe29eb60ca5;p=dbsrgits%2FSQL-Abstract-2.0-ish.git diff --git a/t/200_join.t b/t/200_join.t index 2e89ebc..176ab81 100644 --- a/t/200_join.t +++ b/t/200_join.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 3; use Test::Differences; use_ok('SQL::Abstract') or BAIL_OUT( "$@" ); @@ -9,10 +9,17 @@ use_ok('SQL::Abstract') or BAIL_OUT( "$@" ); my $sqla = SQL::Abstract->create(1); is $sqla->dispatch( - [ -join => - [-name => qw/foo/], - [ '==', [-name => qw/foo id/], [ -name => qw/me foo_id/ ] ] - ] + { -type => 'join', + tablespec => [-name => qw/foo/], + on => [ '==', [-name => qw/foo id/], [ -name => qw/me foo_id/ ] ], + } ), "JOIN foo ON (foo.id = me.foo_id)", "simple join clause"; +is $sqla->dispatch( + { -type => 'join', + tablespec => [-alias => [-name => qw/foo/], 'bar' ], + using => [ -name => qw/foo_id/ ] + } +), "JOIN foo AS bar USING (foo_id)", + "using join clause";