[Bast-commits] r6462 -
DBIx-Class/0.08/branches/order_by_refactor/t/order
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat May 30 14:54:37 GMT 2009
Author: ribasushi
Date: 2009-05-30 14:54:37 +0000 (Sat, 30 May 2009)
New Revision: 6462
Modified:
DBIx-Class/0.08/branches/order_by_refactor/t/order/with_bind.t
Log:
TODOify some of the order with bind tests
Modified: DBIx-Class/0.08/branches/order_by_refactor/t/order/with_bind.t
===================================================================
--- DBIx-Class/0.08/branches/order_by_refactor/t/order/with_bind.t 2009-05-30 09:06:54 UTC (rev 6461)
+++ DBIx-Class/0.08/branches/order_by_refactor/t/order/with_bind.t 2009-05-30 14:54:37 UTC (rev 6462)
@@ -2,6 +2,7 @@
use warnings;
use Test::More;
+use Test::Exception;
use lib qw(t/lib);
use DBICTest;
use DBIC::SqlMakerTest;
@@ -11,14 +12,14 @@
my $rs = $schema->resultset('FourKeys');
sub test_order {
+
+ TODO: {
my $args = shift;
- my $req_order =
- $args->{order_req}
- ? "ORDER BY $args->{order_req}"
- : '';
+ local $TODO = "Not implemented" if $args->{todo};
- is_same_sql_bind(
+ lives_ok {
+ is_same_sql_bind(
$rs->search(
{ foo => 'bar' },
{
@@ -32,13 +33,20 @@
FROM fourkeys me
WHERE ( foo = ? )
HAVING read_count > ? OR read_count < ?
- $req_order
+ ORDER BY $args->{order_req}
)",
[
- [qw(foo bar)], [qw(read_count 5)],
- 8, $args->{bind} ? @{ $args->{bind} } : ()
+ [qw(foo bar)],
+ [qw(read_count 5)],
+ 8,
+ $args->{bind}
+ ? @{ $args->{bind} }
+ : ()
],
- );
+ );
+ };
+ fail('Fail the unfinished is_same_sql_bind') if $@;
+ }
}
my @tests = (
@@ -71,7 +79,10 @@
order_req => 'colA ASC, colB LIKE ? DESC, colC LIKE ? ASC',
bind => [qw(test tost)],
},
- { # this would be really really nice!
+
+ # (mo) this would be really really nice!
+ # (ribasushi) I don't think so, not writing it - patches welcome
+ {
order_by => [
{ -asc => 'colA' },
{ -desc => { colB => { 'LIKE' => 'test' } } },
@@ -79,15 +90,17 @@
],
order_req => 'colA ASC, colB LIKE ? DESC, colC LIKE ? ASC',
bind => [ [ colB => 'test' ], [ colC => 'tost' ] ], # ???
+ todo => 1,
},
{
order_by => { -desc => { colA => { LIKE => 'test' } } },
order_req => 'colA LIKE ? DESC',
bind => [qw(test)],
+ todo => 1,
},
);
-plan( tests => scalar @tests );
+plan( tests => scalar @tests * 2 );
test_order($_) for @tests;
More information about the Bast-commits
mailing list