Added INSERT with example
[dbsrgits/SQL-Abstract-2.0-ish.git] / t / 300_ordering.t
CommitLineData
924d940e 1use strict;
2use warnings;
3
4use Test::More tests => 4;
5use Test::Differences;
6
7use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
8
9my $sqla = SQL::Abstract->create(1);
10
11
12is $sqla->dispatch(
13 { -type => 'ordering', expr => { -type => name => args => [qw/me date/ ] } }
14), "me.date",
15 "basic ordering";
16
17is $sqla->dispatch(
18 { -type => 'ordering',
19 expr => { -type => name => args => [qw/me date/] },
20 direction => 'DESC'
21 }
22), "me.date DESC",
23 "desc ordering";
24
25
26is $sqla->dispatch(
27 { -type => 'ordering',
28 expr => { -type => name => args => [qw/me date/] },
29 direction => 'asc'
30 }
31), "me.date ASC",
32 "asc ordering";