12 given => \'colA DESC',
13 expects => ' ORDER BY colA DESC',
14 expects_quoted => ' ORDER BY colA DESC',
18 expects => ' ORDER BY colA',
19 expects_quoted => ' ORDER BY `colA`',
22 given => [qw/colA colB/],
23 expects => ' ORDER BY colA, colB',
24 expects_quoted => ' ORDER BY `colA`, `colB`',
27 given => {-asc => 'colA'},
28 expects => ' ORDER BY colA ASC',
29 expects_quoted => ' ORDER BY `colA` ASC',
32 given => {-desc => 'colB'},
33 expects => ' ORDER BY colB DESC',
34 expects_quoted => ' ORDER BY `colB` DESC',
37 given => [{-asc => 'colA'}, {-desc => 'colB'}],
38 expects => ' ORDER BY colA ASC, colB DESC',
39 expects_quoted => ' ORDER BY `colA` ASC, `colB` DESC',
43 my $sql = SQL::Abstract->new;
44 my $sqlq = SQL::Abstract->new({quote_char => '`'});
46 plan tests => (scalar(@cases) * 2);
48 for my $case( @cases){
49 is($sql->_order_by($case->{given}), $case->{expects});
50 is($sqlq->_order_by($case->{given}), $case->{expects_quoted});