4 use Test::More tests => 5;
7 use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
9 my $sqla = SQL::Abstract->create(1);
13 { -type => 'expr', op => '==',
15 { -type => 'name', args => [qw/me id/] },
16 { -type => 'alias', ident => { -type => 'name', args => [qw/me id/] }, as => 'bar' }
20 } qr/^'alias' is not a valid AST type in an expression/, "Error from invalid part in where";
24 { -type => 'expr', op => '~' }
26 } qr/^'~' is not a valid operator in an expression/;
28 local $TODO = "Work out how to get nice errors for these";
32 { -type => 'alias', ident => 2 } # no as, inavlid ident
34 } qr/foobar/, "alias: no as, invalid ident";
38 { -type => 'alias', iden => { -type => 'name', args => ['id'] }, as => 'foo' } # iden not ident
40 } qr/foobar/, "alias: iden instead of ident";