7 |
use blib; |
use blib; |
8 |
use jsFind; |
use jsFind; |
9 |
|
|
10 |
my $dict = '/usr/share/dict/words'; |
my $dict; |
11 |
|
|
12 |
if (! -r $dict) { |
BEGIN { |
13 |
plan skip_all => "no $dict"; |
$dict = '/usr/share/dict/words'; |
|
} else { |
|
|
plan tests => 1; |
|
|
} |
|
14 |
|
|
15 |
BEGIN { use_ok('jsFind'); } |
if (! -r $dict) { |
16 |
|
plan skip_all => "no $dict"; |
17 |
|
} else { |
18 |
|
plan tests => 2; |
19 |
|
} |
20 |
|
|
21 |
|
use_ok('jsFind'); |
22 |
|
} |
23 |
|
|
24 |
my $t = new jsFind B => 20; |
my $t = new jsFind B => 20; |
25 |
|
|
35 |
while (<D>) { |
while (<D>) { |
36 |
chomp; |
chomp; |
37 |
|
|
38 |
|
next unless (/^\w+$/); |
39 |
|
|
40 |
$t->B_search(Key => $_, |
$t->B_search(Key => $_, |
41 |
Data => { |
Data => { |
42 |
"$dict" => { |
"$dict" => { |
48 |
Append => 1, |
Append => 1, |
49 |
); |
); |
50 |
$i++; |
$i++; |
51 |
last if ($i > $max); |
last if ($i >= $max); |
52 |
} |
} |
53 |
|
|
54 |
close(D); |
close(D); |