d55e7fda4d871352e11abfd87bb5949f1db86d8f
[dbsrgits/SQL-Abstract-2.0-ish.git] / t / compat / ast / 02update.t
1 use strict;
2 use warnings;
3
4 use FindBin;
5 use lib "$FindBin::Bin/../../lib";
6 use Test::SQL::Abstract::Util qw/
7   mk_name
8   mk_value
9   mk_expr
10   field_op_value
11   :dumper_sort
12 /;
13
14 use SQL::Abstract::Compat;
15
16 use Test::More tests => 2;
17 use Test::Differences;
18
19 ok(my $visitor = SQL::Abstract::Compat->new);
20
21
22 my $foo_id = { -type => 'identifier', elements => [qw/foo/] };
23 my $bar_id = { -type => 'identifier', elements => [qw/bar/] };
24
25 my $foo_eq_1 = field_op_value($foo_id, '==', 1);
26 my $bar_eq_str = field_op_value($bar_id, '==', 'some str');
27
28 local $TODO = 'Work out what this should be';
29 eq_or_diff
30   $visitor->update_ast('test', { foo => 1 }),
31   { -type => 'update',
32     tablespec => mk_name('test'),
33
34   },
35   "simple update";
36
37
38