From: Arthur Axel "fREW" Schmidt <frioux@gmail.com>
Date: Mon, 6 Sep 2010 16:32:44 +0000 (+0000)
Subject: test coloring of keyword
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=110674e1630ce009532c474231cb57a8f9da7e12;p=scpubgit%2FQ-Branch.git

test coloring of keyword
---

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;