[Bps-public-commit] r11348 - DBIx-SearchBuilder/trunk/t
ruz at bestpractical.com
ruz at bestpractical.com
Tue Apr 1 20:10:59 EDT 2008
Author: ruz
Date: Tue Apr 1 20:10:00 2008
New Revision: 11348
Modified:
DBIx-SearchBuilder/trunk/t/02order_outer.t
Log:
* fix test, it should fail when queries don't return any results
Modified: DBIx-SearchBuilder/trunk/t/02order_outer.t
==============================================================================
--- DBIx-SearchBuilder/trunk/t/02order_outer.t (original)
+++ DBIx-SearchBuilder/trunk/t/02order_outer.t Tue Apr 1 20:10:00 2008
@@ -7,7 +7,7 @@
BEGIN { require "t/utils.pl" }
our (@AvailableDrivers);
-use constant TESTS_PER_DRIVER => 96;
+use constant TESTS_PER_DRIVER => 98;
my $total = scalar(@AvailableDrivers) * TESTS_PER_DRIVER;
plan tests => $total;
@@ -68,6 +68,10 @@
);
ok($tags_alias, "joined tags table");
$objs->OrderBy( ALIAS => $tags_alias, FIELD => 'Name', ORDER => 'ASC' );
+
+ ok($objs->First, 'ok, we have at least one result');
+ $objs->GotoFirstItem;
+
my ($order_ok, $last) = (1, '-');
while ( my $obj = $objs->Next ) {
if ( (substr($last, 0, 1) cmp substr($obj->Name, 0, 1)) > 0 ) {
@@ -91,6 +95,10 @@
);
ok($tags_alias, "joined tags table");
$objs->OrderBy( ALIAS => $tags_alias, FIELD => 'Name', ORDER => 'DESC' );
+
+ ok($objs->First, 'ok, we have at least one result');
+ $objs->GotoFirstItem;
+
my ($order_ok, $last) = (1, 'z');
while ( my $obj = $objs->Next ) {
if ( (substr($last, -1, 1) cmp substr($obj->Name, -1, 1)) < 0 ) {
More information about the Bps-public-commit
mailing list