X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F06order_by.t;h=3a29b3d9a771327d9a079feeba36a0460f9b5b2c;hb=5e4361304e44378efe29ad97c4430cd5f5c0f1ba;hp=d92456929e693545fbe185ff86cc6fdc56b7954f;hpb=521647e7e01af89d2deda6724bd76cb399c0bfff;p=dbsrgits%2FSQL-Abstract.git diff --git a/t/06order_by.t b/t/06order_by.t index d924569..3a29b3d 100644 --- a/t/06order_by.t +++ b/t/06order_by.t @@ -104,25 +104,10 @@ my @cases = expects_quoted => ' ORDER BY colA ASC, colB LIKE ? DESC, colC LIKE ? ASC', bind => [qw/test tost/], }, - { - given => [ { -ASC => 'colA', -NULLS => 'FIRST' }, { -DESC => 'colB', -NULLS => 'LAST' } ], - expects => ' ORDER BY colA ASC NULLS FIRST, colB DESC NULLS LAST', - expects_quoted => ' ORDER BY `colA` ASC NULLS FIRST, `colB` DESC NULLS LAST', - }, - { - given => [ { -asc => 'colA', -nulls => 'first' }, { -desc => 'colB', -nulls => 'last' } ], - expects => ' ORDER BY colA ASC NULLS FIRST, colB DESC NULLS LAST', - expects_quoted => ' ORDER BY `colA` ASC NULLS FIRST, `colB` DESC NULLS LAST', - }, - { - given => { -asc => [qw/colA colB/], -nulls => 'first' } , - expects => ' ORDER BY colA ASC NULLS FIRST, colB ASC NULLS FIRST', - expects_quoted => ' ORDER BY `colA` ASC NULLS FIRST, `colB` ASC NULLS FIRST', - }, ); -plan tests => (scalar(@cases) * 2) + 4; +plan tests => (scalar(@cases) * 2) + 2; my $sql = SQL::Abstract->new; my $sqlq = SQL::Abstract->new({quote_char => '`'}); @@ -149,24 +134,12 @@ for my $case( @cases) { throws_ok ( sub { $sql->_order_by({-desc => 'colA', -asc => 'colB' }) }, - qr/hash passed .+ must have exactly one of/, + qr/hash passed .+ must have exactly one key/, 'Undeterministic order exception', ); throws_ok ( sub { $sql->_order_by({-desc => [ qw/colA colB/ ], -asc => [ qw/colC colD/ ] }) }, - qr/hash passed .+ must have exactly one of/, + qr/hash passed .+ must have exactly one key/, 'Undeterministic order exception', ); - -throws_ok( - sub { $sql->_order_by({-wibble => "fleem" }) }, - qr/invalid key in hash/, - 'Invalid order exception', -); - -throws_ok( - sub { $sql->_order_by({-nulls => "fleem" }) }, - qr/invalid value for -nulls/, - 'Invalid nulls exception', -);