4 use Test::More tests => 9;
7 use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
8 use_ok('SQL::Abstract::AST::v1') or BAIL_OUT( "$@" );
10 my $sqla = SQL::Abstract->create(1);
12 # TODO: once MXMS supports %args, use that here
13 is $sqla->dispatch( { -type => 'name', args => [qw/me id/] }), "me.id",
14 "Simple name generator";
16 is $sqla->dispatch( { -type => 'name', args => [qw/me */]}),
18 "Simple name generator";
20 $sqla->quote_chars(['`']);
22 is $sqla->dispatch( { -type => 'name', args => [qw/me */]}),
24 "Simple name generator";
26 $sqla->disable_quoting;
30 ), "0 = 1", "false value";
34 ), "1 = 1", "true value";
39 { -type => name => args => [qw/me id/] },
40 { -type => name => args => [qw/me foo bar/] },
41 { -type => name => args => [qw/bar/] }
44 ), "me.id, me.foo.bar, bar",
48 { -type => 'alias', ident => { -type => name => args => [qw/me id/]}, as => "foobar" }