/[webpac2]/trunk/t/7-est.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/7-est.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (show annotations)
Mon Nov 21 14:42:22 2005 UTC (18 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 766 byte(s)
 r9002@llin:  dpavlin | 2005-11-21 15:43:39 +0100
 Text::Iconv working, fixed tests, minor tweaks

1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use Test::More tests => 6;
6 use Test::Exception;
7 use Cwd qw/abs_path/;
8 use File::Temp qw/tempdir/;
9 use Data::Dumper;
10 use blib;
11
12 BEGIN {
13 use_ok( 'WebPAC::Search::Estraier' );
14 use_ok( 'Log::Log4perl' );
15 }
16
17 Log::Log4perl::init('./conf/log.conf');
18 ok(my $log = Log::Log4perl->get_logger('WebPAC.test'), "get_logger");
19
20 ok(my $est = new WebPAC::Search::Estraier(
21 url => 'http://localhost:1978/node/webpac2',
22 user => 'admin',
23 passwd => 'admin',
24 encoding => 'iso-8859-2',
25 log => $log,
26 ), "new");
27
28 my $query = 'ivan';
29 my $max = 10;
30
31 ok(my @res = $est->search(
32 query => $query,
33 max => $max,
34 attr => [ qw/PersonalName TitleProper/ ],
35 ), "search $query, max: $max");
36
37 cmp_ok(($#res + 1), '==', $max, "$max hits");
38
39 diag Dumper(\@res);
40

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26