File: 12format_keyword.t

package info (click to toggle)
libsql-abstract-perl 2.000001-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 744 kB
  • sloc: perl: 3,443; makefile: 8
file content (25 lines) | stat: -rw-r--r-- 525 bytes parent folder | download | duplicates (4)
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;