--- trunk/t/04words.t 2005/10/19 23:54:21 42 +++ trunk/t/04words.t 2008/02/24 20:04:59 43 @@ -7,15 +7,19 @@ use blib; use jsFind; -my $dict = '/usr/share/dict/words'; +my $dict; -if (! -r $dict) { - plan skip_all => "no $dict"; -} else { - plan tests => 1; -} +BEGIN { + $dict = '/usr/share/dict/words'; -BEGIN { use_ok('jsFind'); } + if (! -r $dict) { + plan skip_all => "no $dict"; + } else { + plan tests => 2; + } + + use_ok('jsFind'); +} my $t = new jsFind B => 20; @@ -31,6 +35,8 @@ while () { chomp; + next unless (/^\w+$/); + $t->B_search(Key => $_, Data => { "$dict" => { @@ -42,7 +48,7 @@ Append => 1, ); $i++; - last if ($i > $max); + last if ($i >= $max); } close(D);