expand alias
[dbsrgits/SQL-Abstract.git] / t / 13whitespace_keyword.t
CommitLineData
b4e0e260 1use strict;
2use warnings;
3
4use Test::More;
5use SQL::Abstract::Tree;
6
7my $sqlat = SQL::Abstract::Tree->new({
ee4227a7 8 newline => "\n",
9 indent_string => " ",
10 indent_amount => 1,
11 indentmap => {
b4e0e260 12 select => 0,
13 where => 1,
14 from => 2,
15 join => 3,
16 on => 4,
17 'group by' => 5,
18 'order by' => 6,
ee4227a7 19 },
b4e0e260 20});
21
22for ( keys %{$sqlat->indentmap}) {
f2ab166a 23 my ($l, $r) = @{$sqlat->pad_keyword($_, 1)};
e4570c8e 24 is($r, '', "right is empty for $_");
ee4227a7 25 is($l, "\n " . ' ' x $sqlat->indentmap->{$_}, "left calculated correctly for $_" );
b4e0e260 26}
27
f2ab166a 28is($sqlat->pad_keyword('select', 0)->[0], '', 'Select gets no newline or indent for depth 0');
b4e0e260 29
30done_testing;