[Rt-commit] r12812 - in rt/branches/3.8-TESTING: .
alexmv at bestpractical.com
alexmv at bestpractical.com
Mon Jun 2 16:53:19 EDT 2008
Author: alexmv
Date: Mon Jun 2 16:53:19 2008
New Revision: 12812
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t
rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t
rt/branches/3.8-TESTING/t/ticket/sort-by-user.t
Log:
r32395 at kohr-ah: chmrr | 2008-06-02 16:52:36 -0400
* Fix tests for nulls coming last in Pg
* Typo in queue creation also caused Pg to flip out
Modified: rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-multiple.t Mon Jun 2 16:53:19 2008
@@ -82,8 +82,11 @@
or $error = 1;
my ($order_ok, $last) = (1, $order eq 'ASC'? '-': 'zzzzzz');
+ my $last_id = $tix->Last->id;
while ( my $t = $tix->Next ) {
my $tmp;
+ next if $t->id == $last_id and $t->Subject eq "-"; # Nulls are allowed to come last, in Pg
+
if ( $order eq 'ASC' ) {
$tmp = ((split( /,/, $last))[0] cmp (split( /,/, $t->Subject))[0]);
} else {
Modified: rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/cfsort-freeform-single.t Mon Jun 2 16:53:19 2008
@@ -13,12 +13,12 @@
# Test Sorting by FreeformSingle custom field.
diag "Create a queue to test with.";
-my $queue_name = "CFSortQueue$$";
+my $queue_name = "CFSortQueue-$$";
my $queue;
{
$queue = RT::Queue->new( $RT::SystemUser );
my ($ret, $msg) = $queue->Create(
- Name => $queue,
+ Name => $queue_name,
Description => 'queue for custom field sort testing'
);
ok($ret, "$queue test queue creation. $msg");
@@ -91,8 +91,11 @@
or $error = 1;
my ($order_ok, $last) = (1, $order eq 'ASC'? '-': 'zzzzzz');
+ my $last_id = $tix->Last->id;
while ( my $t = $tix->Next ) {
my $tmp;
+ next if $t->id == $last_id and $t->Subject eq "-"; # Nulls are allowed to come last, in Pg
+
if ( $order eq 'ASC' ) {
$tmp = ((split( /,/, $last))[0] cmp (split( /,/, $t->Subject))[0]);
} else {
Modified: rt/branches/3.8-TESTING/t/ticket/sort-by-user.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/sort-by-user.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/sort-by-user.t Mon Jun 2 16:53:19 2008
@@ -21,7 +21,7 @@
{
$queue = RT::Queue->new( $RT::SystemUser );
my ($ret, $msg) = $queue->Create(
- Name => $queue,
+ Name => $queue_name,
Description => 'queue for custom field sort testing'
);
ok($ret, "$queue test queue creation. $msg");
More information about the Rt-commit
mailing list