X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F12format_keyword.t;fp=t%2F12format_keyword.t;h=a1cd8d8e4051819b1422957cbff003e9078e44fc;hb=110674e1630ce009532c474231cb57a8f9da7e12;hp=0000000000000000000000000000000000000000;hpb=f088a68d4d4c441167ca5c582c84a04a52fdac98;p=scpubgit%2FQ-Branch.git diff --git a/t/12format_keyword.t b/t/12format_keyword.t new file mode 100644 index 0000000..a1cd8d8 --- /dev/null +++ b/t/12format_keyword.t @@ -0,0 +1,25 @@ +use strict; +use warnings; + +use Test::More; +use SQL::Abstract::Tree; + +my $sqlat = SQL::Abstract::Tree->new({ + colormap => { + select => ['s(', ')s'], + where => ['w(', ')w'], + from => ['f(', ')f'], + join => ['j(', ')f'], + on => ['o(', ')o'], + 'group by' => ['gb(',')gb'], + 'order by' => ['ob(',')ob'], + }, +}); + +for ( keys %{$sqlat->colormap}) { + my ($l, $r) = @{$sqlat->colormap->{$_}}; + is($sqlat->format_keyword($_), "$l$_$r", "$_ 'colored' correctly"); +} + + +done_testing;