File: 12format_keyword.t

package info (click to toggle)
libsql-abstract-perl 1.72-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 532 kB
  • sloc: perl: 6,501; makefile: 14
file content (25 lines) | stat: -rw-r--r-- 535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;