12 |
|
|
13 |
my $t = new jsFind B => 100; |
my $t = new jsFind B => 100; |
14 |
|
|
15 |
ok(-e "t/ulyss12.txt", "The Project Gutenberg EBook of Ulysses, by James Joyce"); |
ok(-e "t/homer.txt", "Homer: The Odyssey preface"); |
16 |
|
|
17 |
my $p = 0; |
my $p = 0; |
18 |
my $text = ''; |
my $text = ''; |
19 |
my %words; |
my %words; |
20 |
my $max = 1; |
my $max = 2; |
21 |
|
|
22 |
my $res; |
my $res; |
23 |
|
|
24 |
ok(open(U, "t/ulyss12.txt"), "open ulyss12.txt"); |
ok(open(U, "t/homer.txt"), "open homer.txt"); |
25 |
while(<U>) { |
while(<U>) { |
26 |
chomp; |
chomp; |
27 |
if (/^\s*$/) { |
if (/^\s*$/) { |
78 |
|
|
79 |
my $total_words = scalar keys %words; |
my $total_words = scalar keys %words; |
80 |
|
|
81 |
cmp_ok($t->to_jsfind("./html/ulyss"), '==', $total_words, " jsfind index with $total_words words"); |
cmp_ok($t->to_jsfind("./html/homer"), '==', $total_words, " jsfind index with $total_words words"); |