4 use Test::More tests => 6;
8 use lib "$FindBin::Bin/lib";
9 use Test::SQL::Abstract::Util qw/
15 use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
17 my $sqla = SQL::Abstract->create(1);
21 { -type => 'expr', op => '==',
23 { -type => 'identifier', elements => [qw/me id/] },
24 { -type => 'alias', ident => { -type => 'identifier', elements => [qw/me id/] }, as => 'bar' }
28 } qr/^'alias' is not a valid AST type in an expression/, "Error from invalid part in where";
32 { -type => 'expr', op => '~' }
34 } qr/^'~' is not a valid operator in an expression/;
37 local $TODO = "Work out how to get nice errors for these";
41 { -type => 'alias', ident => 2 } # no as, inavlid ident
43 } qr/foobar/, "alias: no as, invalid ident";
47 { -type => 'alias', iden => { -type => 'identifier', elements => ['id'] }, as => 'foo' } # iden not ident
49 } qr/foobar/, "alias: iden instead of ident";
56 tablespec => mk_name('test'),
59 mk_alias(mk_name(qw/foo id/) ,'foo_id')
63 } qr/^'values' is required in update AST/, "Invalid clause in update"