Update clases test+functionality
[dbsrgits/SQL-Abstract-2.0-ish.git] / t / 202_update.t
CommitLineData
d4656fcf 1use strict;
2use warnings;
3
fc20481d 4use Test::More tests => 2;
d4656fcf 5use Test::Differences;
6
7use FindBin;
8use lib "$FindBin::Bin/lib";
9use Test::SQL::Abstract::Util qw/
10 mk_name
11 mk_value
12 mk_alias
fc20481d 13 mk_expr
d4656fcf 14 :dumper_sort
15/;
16
17use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
18
19my $sqla = SQL::Abstract->create(1);
20
21is $sqla->dispatch(
22 { -type => 'update',
23 tablespec => mk_name('test'),
24 columns => [
25 mk_name(qw/me id/),
26 mk_name(qw/hostname/),
27 ],
28 values => [
29 mk_expr('+', mk_name(qw/me id/), mk_value(5)),
30 mk_value('localhost'),
31 ]
32 }
fc20481d 33), "UPDATE test SET me.id = me.id + ?, hostname = ?",
d4656fcf 34 "update clause";