4 use Test::More tests => 8;
7 use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
9 my $sqla = SQL::Abstract->create(1);
11 # TODO: once MXMS supports %args, use that here
12 is $sqla->dispatch( { -type => 'name', args => [qw/me id/] }), "me.id",
13 "Simple name generator";
15 is $sqla->dispatch( { -type => 'name', args => [qw/me */]}),
17 "Simple name generator";
19 $sqla->quote_chars(['`']);
21 is $sqla->dispatch( { -type => 'name', args => [qw/me */]}),
23 "Simple name generator";
25 $sqla->disable_quoting;
29 ), "0 = 1", "false value";
33 ), "1 = 1", "true value";
38 { -type => name => args => [qw/me id/] },
39 { -type => name => args => [qw/me foo bar/] },
40 { -type => name => args => [qw/bar/] }
43 ), "me.id, me.foo.bar, bar",
47 { -type => 'alias', ident => { -type => name => args => [qw/me id/]}, as => "foobar" }