X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2Ft%2Fregression%2F12-search.t;h=c775f937248a32a10e0485bf3c46edf026f65875;hb=fc6209f398899f0211cfcedeb81a3cd65e04a941;hp=210d4fe33c14d2445354980ba4885f9d76ec434b;hpb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4;p=freeside.git diff --git a/rt/lib/t/regression/12-search.t b/rt/lib/t/regression/12-search.t index 210d4fe33..c775f9372 100644 --- a/rt/lib/t/regression/12-search.t +++ b/rt/lib/t/regression/12-search.t @@ -142,67 +142,82 @@ ok( $id, $msg ); # we have tickets. start searching my $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue'"); -is($tix->Count, 7, "found all the tickets"); +is($tix->Count, 7, "found all the tickets") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; # very simple searches. both CF and normal $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND CF.SearchTest = 'foo1'"); -is($tix->Count, 1, "matched identical subject"); +is($tix->Count, 1, "matched identical subject") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND CF.SearchTest LIKE 'foo1'"); -is($tix->Count, 1, "matched LIKE subject"); +is($tix->Count, 1, "matched LIKE subject") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND CF.SearchTest = 'foo'"); -is($tix->Count, 0, "IS a regexp match"); +is($tix->Count, 0, "IS a regexp match") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND CF.SearchTest LIKE 'foo'"); -is($tix->Count, 5, "matched LIKE subject"); +is($tix->Count, 5, "matched LIKE subject") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND CF.SearchTest IS NULL"); -is($tix->Count, 2, "IS null CF"); +is($tix->Count, 2, "IS null CF") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Requestors LIKE 'search1'"); -is($tix->Count, 1, "LIKE requestor"); +is($tix->Count, 1, "LIKE requestor") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Requestors = 'search1\@example.com'"); -is($tix->Count, 1, "IS requestor"); +is($tix->Count, 1, "IS requestor") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Requestors LIKE 'search'"); -is($tix->Count, 6, "LIKE requestor"); +is($tix->Count, 6, "LIKE requestor") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Requestors IS NULL"); -is($tix->Count, 1, "Search for no requestor"); +is($tix->Count, 1, "Search for no requestor") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Subject = 'SearchTest1'"); -is($tix->Count, 1, "IS subject"); +is($tix->Count, 1, "IS subject") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Subject LIKE 'SearchTest1'"); -is($tix->Count, 1, "LIKE subject"); +is($tix->Count, 1, "LIKE subject") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Subject = ''"); -is($tix->Count, 1, "found one ticket"); +is($tix->Count, 1, "found one ticket") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Subject LIKE 'SearchTest'"); -is($tix->Count, 6, "found two ticket"); +is($tix->Count, 6, "found two ticket") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery; $tix = RT::Tickets->new($RT::SystemUser); $tix->FromSQL("Queue = '$queue' AND Subject LIKE 'qwerty'"); -is($tix->Count, 0, "found zero ticket"); +is($tix->Count, 0, "found zero ticket") + or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;