/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 126 - (hide annotations)
Thu Nov 24 11:47:21 2005 UTC (18 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 783 byte(s)
 r9090@llin:  dpavlin | 2005-11-24 12:48:47 +0100
 fix

1 dpavlin 80 #!/usr/bin/perl -w
2    
3     use strict;
4    
5 dpavlin 81 use Test::More tests => 6;
6 dpavlin 80 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 dpavlin 126 debug => 1,
27 dpavlin 80 ), "new");
28    
29     my $query = 'ivan';
30 dpavlin 126 my $max = 3;
31 dpavlin 80
32     ok(my @res = $est->search(
33 dpavlin 126 phrase => $query,
34     get_attr => [ qw/PersonalName TitleProper/ ],
35 dpavlin 80 max => $max,
36     ), "search $query, max: $max");
37    
38 dpavlin 81 cmp_ok(($#res + 1), '==', $max, "$max hits");
39 dpavlin 80
40     diag Dumper(\@res);
41    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26