/[SWISH-PlusPlus]/trunk/t/swish.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

Diff of /trunk/t/swish.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3 by dpavlin, Fri Dec 3 15:23:23 2004 UTC revision 8 by dpavlin, Sat Dec 4 17:49:20 2004 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 5;  use Test::More tests => 11;
6  use Test::Exception;  use Test::Exception;
7  use blib;  use blib;
8    
# Line 19  my $index = '/tmp/swish-pp'; Line 19  my $index = '/tmp/swish-pp';
19    
20  $i = SWISH::PlusPlus->open(  $i = SWISH::PlusPlus->open(
21          index_dir => $index,          index_dir => $index,
22            debug => 0,
23  );  );
24  ok($i, "open index");  ok($i, "open index");
25    
# Line 27  ok(-e $index, "index exist"); Line 28  ok(-e $index, "index exist");
28  ok($i->check_bin, "swish++ check");  ok($i->check_bin, "swish++ check");
29    
30  diag $i->{'version'} || die;  diag $i->{'version'} || die;
31    
32    ok($i->index_document( 42 => 'meaning of life' ), "index 42");
33    
34    # add one dummy document so that swish++ won't reject all words
35    # with index of just one document
36    ok($i->index_document( _dummy_ => '' ), "fillter");
37    
38    cmp_ok($i->{'index_dir'}, 'eq', $index, "index_dir ok");
39    
40    foreach my $word (qw(meaning of life)) {
41            my @r = $i->search($word);
42            cmp_ok(scalar @r, '==', 1, "find $word");
43    }

Legend:
Removed from v.3  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26