use strict;
use warnings;
use Test::More tests => 3;
use Test::Exception;
use SQL::Abstract::Limit;
use SQL::Abstract;
{
my $sql = SQL::Abstract::Limit->new( limit_dialect => 'LimitOffset' );
my $stmt = $sql->select("MY_TABLE", "*", undef, ["id"], undef, undef);
my $expect = 'SELECT * FROM MY_TABLE ORDER BY id';
like( $stmt, qr~\Q$expect\E~, 'no-LIMIT with ORDER BY' );
my $stmt2 = SQL::Abstract->new->select("MY_TABLE", "*", undef, ["id"]);
like( $stmt2, qr~\Q$expect\E~, 'SQL::Abstract base stmt' );
}
{
my $sql = SQL::Abstract::Limit->new( limit_dialect => 'LimitOffset' );
my $stmt = $sql->where( { fee => 'fi' }, ["id"] );
like( $stmt, qr/ORDER BY id/, 'got an order_by clause' );
}