Note successes in record.
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Test / Search / Title.pm
1 # $Id: Title.pm,v 1.3 2006-07-24 17:02:51 mike Exp $
2
3 # See the "Main" test package for documentation
4
5 package ZOOM::IRSpy::Test::Search::Title;
6
7 use 5.008;
8 use strict;
9 use warnings;
10
11 use ZOOM::IRSpy::Test;
12 our @ISA;
13 @ISA = qw(ZOOM::IRSpy::Test);
14
15
16 sub run {
17     my $this = shift();
18     my $irspy = $this->irspy();
19     my $pod = $irspy->pod();
20
21     $pod->callback(ZOOM::Event::RECV_SEARCH, \&found);
22     $pod->search_pqf('@attr 1=4 computer');
23     my $err = $pod->wait($irspy);
24     ### Should notice failure and log it.
25
26     return 0;
27 }
28
29
30 sub found {
31     my($conn, $irspy, $rs, $event) = @_;
32
33     my $rec = $irspy->record($conn);
34     my $n = $rs->size();
35     $irspy->log("irspy_test", $conn->option("host"),
36                 " title search found $n record", $n==1 ? "" : "s");
37     $rec->append_entry("irspy:status", "<irspy:search_title ok='1'>" .
38                        $irspy->isodate(time()) . "</irspy:search_title>");
39     return 0;
40 }
41
42
43 1;