1 # $Id: Boolean.pm,v 1.3 2006-10-26 10:24:20 sondberg Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Search::Boolean;
11 use ZOOM::IRSpy::Test;
12 our @ISA = qw(ZOOM::IRSpy::Test);
18 my %pqfs = ('and' => '@and @attr 1=4 mineral @attr 1=4 water',
19 'or' => '@or @attr 1=4 mineral @attr 1=4 water',
20 'not' => '@not @attr 1=4 mineral @attr 1=4 water',
21 'and-or'=> '@and @or @attr 1=4 mineral @attr 1=4 water ' .
25 foreach my $operator (keys %pqfs) {
26 $conn->irspy_search_pqf($pqfs{$operator},
27 {'operator' => $operator}, {},
28 ZOOM::Event::RECV_SEARCH, \&found,
29 exception => \&error);
35 my($conn, $task, $test_args, $event) = @_;
36 my $operator = $test_args->{'operator'};
37 my $n = $task->{rs}->size();
39 $conn->log("irspy_test", "search using boolean operator ", $operator,
40 " found $n record", $n==1 ? "" : "s");
41 update($conn, $operator, 1);
43 return ZOOM::IRSpy::Status::TASK_DONE;
48 my($conn, $task, $test_args, $exception) = @_;
49 my $operator = $test_args->{'operator'};
51 $conn->log("irspy_test", "search using boolean operator ", $operator,
52 " had error: ", $exception);
53 update($conn, $operator, 0);
54 return ZOOM::IRSpy::Status::TASK_DONE;
59 my ($conn, $operator, $ok) = @_;
61 $conn->record()->store_result('boolean', 'operator' => $operator,