X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F900_errors.t;fp=t%2F900_errors.t;h=b86eda0a0ce4d579ea61f44198a5eebb234256db;hb=d4656fcf868ce52c9689c1036628e04993eb5e59;hp=f885a89c0b091c0591ab52e24a78dc6caaf68b12;hpb=96bbece0b664b9225ef1f94a5224f5d5bcee4207;p=dbsrgits%2FSQL-Abstract-2.0-ish.git diff --git a/t/900_errors.t b/t/900_errors.t index f885a89..b86eda0 100644 --- a/t/900_errors.t +++ b/t/900_errors.t @@ -1,9 +1,17 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 6; use Test::Exception; +use FindBin; +use lib "$FindBin::Bin/lib"; +use Test::SQL::Abstract::Util qw/ + mk_name + mk_value + mk_alias +/; + use_ok('SQL::Abstract') or BAIL_OUT( "$@" ); my $sqla = SQL::Abstract->create(1); @@ -25,6 +33,7 @@ throws_ok { ) } qr/^'~' is not a valid operator in an expression/; +{ local $TODO = "Work out how to get nice errors for these"; throws_ok { @@ -39,3 +48,16 @@ throws_ok { ) } qr/foobar/, "alias: iden instead of ident"; +} + +throws_ok { + $sqla->dispatch( + { -type => 'update', + tablespec => mk_name('test'), + columns => [ + mk_name(qw/me id/), + mk_alias(mk_name(qw/foo id/) ,'foo_id') + ] + } + ) +} qr/^'values' is required in update AST/, "Invalid clause in update"