2 # See the "Main" test package for documentation
4 package ZOOM::IRSpy::Test::Search::Boolean;
10 use ZOOM::IRSpy::Test;
11 our @ISA = qw(ZOOM::IRSpy::Test);
17 my %pqfs = ('and' => '@and @attr 1=4 mineral @attr 1=4 water',
18 'or' => '@or @attr 1=4 mineral @attr 1=4 water',
19 'not' => '@not @attr 1=4 mineral @attr 1=4 water',
20 'and-or'=> '@and @or @attr 1=4 mineral @attr 1=4 water ' .
24 foreach my $operator (keys %pqfs) {
25 $conn->irspy_search_pqf($pqfs{$operator},
26 {'operator' => $operator}, {},
27 ZOOM::Event::ZEND, \&found,
28 exception => \&error);
34 my($conn, $task, $test_args, $event) = @_;
35 my $operator = $test_args->{'operator'};
37 my $n = $task->{rs}->size();
38 $task->{rs}->destroy();
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 $task->{rs}->destroy();
52 $conn->log("irspy_test", "search using boolean operator ", $operator,
53 " had error: ", $exception);
54 update($conn, $operator, 0);
55 return ZOOM::IRSpy::Status::TASK_DONE;
60 my ($conn, $operator, $ok) = @_;
62 $conn->record()->store_result('boolean', 'operator' => $operator,