[Rt-commit] r2799 - in rt/branches/QUEBEC-EXPERIMENTAL: . lib/RT/Search lib/t/regression

jesse at bestpractical.com jesse at bestpractical.com
Thu Apr 21 16:04:51 EDT 2005


Author: jesse
Date: Thu Apr 21 16:04:51 2005
New Revision: 2799

Modified:
   rt/branches/QUEBEC-EXPERIMENTAL/   (props changed)
   rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Search/Googleish.pm
   rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/19quicksearch.t
Log:
 r14015 at hualien:  jesse | 2005-04-21 16:03:36 -0400
 * Simple search fixes for searching by multiple values of one criterion
 


Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Search/Googleish.pm	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Search/Googleish.pm	Thu Apr 21 16:04:51 2005
@@ -144,7 +144,7 @@
     push @tql_clauses, join( " OR ", sort @status_clauses );
     push @tql_clauses, join( " OR ", sort @user_clauses );
     push @tql_clauses, join( " OR ", sort @queue_clauses );
-    @tql_clauses = grep { $_ ? "( $_ )" : undef } @tql_clauses;
+    @tql_clauses = grep { $_ ? $_ = "( $_ )" : undef } @tql_clauses;
     return join " AND ", sort @tql_clauses;
 }
 # }}}

Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/19quicksearch.t
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/19quicksearch.t	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/19quicksearch.t	Thu Apr 21 16:04:51 2005
@@ -10,12 +10,12 @@
 RT::Init();
 
 my $q = RT::Queue->new($RT::SystemUser);
-my $queue = 'SearchTests-'.rand(200);
+my $queue = 'SearchTests-'.$$;
 $q->Create(Name => $queue);
 ok ($q->id, "Created the queue");
 
 my $t1 = RT::Ticket->new($RT::SystemUser);
-my ( $id, undef $msg ) = $t1->Create(
+my ( $id, undef, $msg ) = $t1->Create(
     Queue      => $q->id,
     Subject    => 'SearchTest1',
     Requestor => ['search2 at example.com'],
@@ -27,11 +27,12 @@
 my $quick = RT::Search::Googleish->new(Argument => "",
                                  TicketsObj => $tickets);
 my @tests = (
-    "fulltext:jesse"       => "Content LIKE 'jesse'",
-    $queue                 => "Queue = '$queue'",
-    "root $queue"          => "Owner = 'root' AND Queue = '$queue'",
-    "notauser $queue"      => "Queue = '$queue' AND Subject LIKE 'notauser'",
-    "notauser $queue root" => "Owner = 'root' AND Queue = '$queue' AND Subject LIKE 'notauser'");
+    "General new open root"     => "( Owner = 'root' ) AND ( Queue = 'General' ) AND ( Status = 'new' OR Status = 'open' )", 
+    "fulltext:jesse"       => "( Content LIKE 'jesse' )",
+    $queue                 => "( Queue = '$queue' )",
+    "root $queue"          => "( Owner = 'root' ) AND ( Queue = '$queue' )",
+    "notauser $queue"      => "( Queue = '$queue' ) AND ( Subject LIKE 'notauser' )",
+    "notauser $queue root" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( Subject LIKE 'notauser' )");
 
 while (my ($from, $to) = splice @tests, 0, 2) {
     is($quick->QueryToSQL($from), $to, "<$from> -> <$to>");


More information about the Rt-commit mailing list