/[jsFind]/trunk/t/04words.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/04words.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 42 by dpavlin, Sun Oct 24 11:13:22 2004 UTC revision 43 by dpavlin, Sun Feb 24 20:04:59 2008 UTC
# Line 7  use Test::More; Line 7  use Test::More;
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    
# Line 31  if (-r $dict) { Line 35  if (-r $dict) {
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" => {
# Line 42  if (-r $dict) { Line 48  if (-r $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);

Legend:
Removed from v.42  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.26