--- test.pl 2002/02/11 14:33:42 1.2 +++ test.pl 2002/02/11 20:19:59 1.3 @@ -6,9 +6,11 @@ my $affix_file='/usr/lib/ispell/english.aff'; my @test_words=( 'cars', 'dogs' ); +my $findaffix_file='./findaffix.out'; + my $loaded = 0; -BEGIN { $| = 1; print "1..4\n"; } +BEGIN { $| = 1; print "1..6\n"; } END {print "not ok 1\n" unless $loaded;} use Lingua::Spelling::Alternative; @@ -23,7 +25,6 @@ ### test load affix - if ( -e $affix_file ) { my $ok = $a->load_affix($affix_file); print 'not ' if (! $ok); @@ -37,3 +38,22 @@ print "ok 4 # - Skip\n"; } +undef $a; + +### test load findaffix + +if ( -e $findaffix_file ) { + my $a = new Lingua::Spelling::Alternative( DEBUG => 1 ) ; + + my $ok = $a->load_findaffix($findaffix_file); + print 'not ' if (! $ok); + print "ok 5\n"; + + my @words = $a->alternatives(@test_words); + print 'not ' if (! @words); + print "ok 6 # - ",join(", ",@test_words)," -> ",join(", ",@words),"\n"; +} else { + print "ok 5 # - Skip, findaffix file '$findaffix_file' not found\n"; + print "ok 6 # - Skip\n"; +} +