Make more of the expression (formerly basic where) tests pass
[dbsrgits/SQL-Abstract-2.0-ish.git] / t / 101_where_error.t
CommitLineData
0c371882 1use strict;
2use warnings;
3
4use Test::More tests => 3;
5use Test::Exception;
6
7use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
8
9my $sqla = SQL::Abstract->create(1);
10
11throws_ok {
12 $sqla->dispatch(
13 [ -where =>
14 [ '==', [-name => qw/me id/], [ -alias => [-name => qw/me foo/], 'bar' ] ]
15 ]
16 )
17} qr/^'-alias' is not a valid clause in a where AST/, "Error from invalid part in where";
18
19throws_ok {
20 $sqla->dispatch(
21 [ -where =>
22 [ '~', [-name => qw/me id/], [ -alias => [-name => qw/me foo/], 'bar' ] ]
23 ]
24 )
25} qr/^'~' is not a valid operator/,
26 "Error from invalid operator in where";