/[Lingua-Spelling-Alternative]/test.pl
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 /test.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Mon Feb 11 14:33:42 2002 UTC (20 years, 11 months ago) by dpavlin
Branch: MAIN
Changes since 1.1: +1 -1 lines
File MIME type: text/plain
DEBUG option to new constructor

1 #!perl -w
2
3 use strict;
4
5 # init some vars
6 my $affix_file='/usr/lib/ispell/english.aff';
7 my @test_words=( 'cars', 'dogs' );
8
9 my $loaded = 0;
10
11 BEGIN { $| = 1; print "1..4\n"; }
12 END {print "not ok 1\n" unless $loaded;}
13
14 use Lingua::Spelling::Alternative;
15 $loaded = 1;
16 print "ok 1\n";
17
18 ### test constructor
19
20 my $a = new Lingua::Spelling::Alternative( DEBUG => 1 ) ;
21
22 defined($a) || print 'not '; print "ok 2\n";
23
24 ### test load affix
25
26
27 if ( -e $affix_file ) {
28 my $ok = $a->load_affix($affix_file);
29 print 'not ' if (! $ok);
30 print "ok 3\n";
31
32 my @words = $a->alternatives(@test_words);
33 print 'not ' if (! @words);
34 print "ok 4 # - ",join(", ",@test_words)," -> ",join(", ",@words),"\n";
35 } else {
36 print "ok 3 # - Skip, affix file '$affix_file' not found\n";
37 print "ok 4 # - Skip\n";
38 }
39

  ViewVC Help
Powered by ViewVC 1.1.26