test coloring of keyword
Arthur Axel "fREW" Schmidt [Mon, 6 Sep 2010 16:32:44 +0000 (16:32 +0000)]
t/12format_keyword.t [new file with mode: 0644]

diff --git a/t/12format_keyword.t b/t/12format_keyword.t
new file mode 100644 (file)
index 0000000..a1cd8d8
--- /dev/null
@@ -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;