1 # $Id: Boolean.pm,v 1.5 2007-03-15 11:40:39 mike 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::ZEND, \&found,
29 exception => \&error);
35 my($conn, $task, $test_args, $event) = @_;
36 my $operator = $test_args->{'operator'};
38 my $n = $task->{rs}->size();
39 $task->{rs}->destroy();
40 $conn->log("irspy_test", "search using boolean operator ", $operator,
41 " found $n record", $n==1 ? "" : "s");
42 update($conn, $operator, 1);
44 return ZOOM::IRSpy::Status::TASK_DONE;
49 my($conn, $task, $test_args, $exception) = @_;
50 my $operator = $test_args->{'operator'};
52 $task->{rs}->destroy();
53 $conn->log("irspy_test", "search using boolean operator ", $operator,
54 " had error: ", $exception);
55 update($conn, $operator, 0);
56 return ZOOM::IRSpy::Status::TASK_DONE;
61 my ($conn, $operator, $ok) = @_;
63 $conn->record()->store_result('boolean', 'operator' => $operator,