X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcompat%2Fast%2F02update.t;fp=t%2Fcompat%2Fast%2F02update.t;h=d55e7fda4d871352e11abfd87bb5949f1db86d8f;hb=73e799a6702cd272253307216d5ee99b1babba20;hp=0000000000000000000000000000000000000000;hpb=5ec9ab1928e624428ecdf787800d686f57de12af;p=dbsrgits%2FSQL-Abstract-2.0-ish.git diff --git a/t/compat/ast/02update.t b/t/compat/ast/02update.t new file mode 100644 index 0000000..d55e7fd --- /dev/null +++ b/t/compat/ast/02update.t @@ -0,0 +1,38 @@ +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../../lib"; +use Test::SQL::Abstract::Util qw/ + mk_name + mk_value + mk_expr + field_op_value + :dumper_sort +/; + +use SQL::Abstract::Compat; + +use Test::More tests => 2; +use Test::Differences; + +ok(my $visitor = SQL::Abstract::Compat->new); + + +my $foo_id = { -type => 'identifier', elements => [qw/foo/] }; +my $bar_id = { -type => 'identifier', elements => [qw/bar/] }; + +my $foo_eq_1 = field_op_value($foo_id, '==', 1); +my $bar_eq_str = field_op_value($bar_id, '==', 'some str'); + +local $TODO = 'Work out what this should be'; +eq_or_diff + $visitor->update_ast('test', { foo => 1 }), + { -type => 'update', + tablespec => mk_name('test'), + + }, + "simple update"; + + +