2 # Before 'make install' is performed this script should be runnable with
3 # 'make test'. After 'make install' it should work as 'perl test.pl'
5 #########################
9 BEGIN {$SIG{__WARN__} = sub { die "Terminating test due to warning: $_[0]" } };
12 BEGIN { plan tests => 5 };
13 use Xapian qw(:standard);
15 ok(1); # If we made it this far, we're ok.
17 #########################
19 foreach my $l (split(/ /, Xapian::Stem::get_available_languages())) {
20 my $s = new Xapian::Stem($l);
23 # Test user-specified stemmers, using the naive "truncate to 3 characters"
26 ok( $stemmer = new Xapian::Stem(sub {substr($_[0], 0, 3)}) );
27 is( $stemmer->stem_word("honey"), "hon" );
28 is( $stemmer->stem_word("b"), "b" );