Changeset 2094 for Swishetest
- Timestamp:
- 03/19/08 20:35:31 (9 months ago)
- Files:
-
- Swishetest/trunk/t/030-C030-medsm-xml.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Swishetest/trunk/t/030-C030-medsm-xml.t
r2040 r2094 24 24 # predict number of tests based on number of files in dictionaries and number of index types 25 25 26 # ONE ORDER 27 my @dicts = qw( data/C020-words-txt/words-linux-fc1.txt data/C020-words-txt/words-osx-10_3.txt); 26 #my @dicts = qw( data/C020-words-txt/words-linux-fc1.txt data/C020-words-txt/words-osx-10_3.txt); 27 #my @dicts = qw( data/C020-words-txt/words-osx-10_3.txt); # skip smaller linux words list 28 my @dicts = qw( data/C020-words-txt/words-linux-fc1.txt ); # skip larger osx words list 28 29 29 # THE OTHER ORDER30 #my @dicts = qw( data/C020-words-txt/words-osx-10_3.txt data/C020-words-txt/words-linux-fc1.txt );31 30 32 31 my @dictwordcounts = map { `wc -l $_ | awk '{print \$1}' ` } @dicts; 33 32 chomp(@dictwordcounts); 34 33 my $numdictwords = sum( @dictwordcounts ); 35 #my @filetypes = qw(html xml txt); 36 my @filetypes = qw(txt xml html); 34 35 my @filetypes = qw(txt xml html); # simpler to more complex 37 36 my $numdicts = scalar(@dicts); 38 37 my $numfiletypes = scalar(@filetypes); 39 38 my $totalnumtests = $numfiletypes * $numdictwords + scalar(@dicts) * scalar(@filetypes) * 3; 40 # three tests plus one for each word, for each dictionary and filetype.41 #plan tests => ($numdicts * $numfiletypes * (3 + $max_words ));42 39 plan tests => $totalnumtests; 43 40 mkpath( ["blib/index"], 0, 0755); 44 41 my $base = "C030"; 45 42 for my $dict (@dicts) { 43 ( my $dictname = $dict ) =~ s/^.*-(([^.]|-)+)\.txt$/$1/; 46 44 for my $filetype ( @filetypes ) { 47 ( my $dictname = $dict ) =~ s/^.*-(([^.]|-)+)\.txt$/$1/;48 #( my $dictname = $dict ) =~ s/\.txt$//; # this doesn't work49 #$dictname =~ s![^/]*/!!; # this doesn't work50 45 51 46 my $index = "blib/index/${base}_${dictname}_${filetype}.index"; … … 72 67 # ($word =~ /^\s*(and|or|not|near)\s*$/i) ? 0 : ($word_count->{lc($word)} || 1)); 73 68 my $num_expected_rows = $word_count->{lc($word)}; 74 cmp_ok(scalar(@rows), "==", $num_expected_rows, " search '$word' ($filetype index from $dict)");69 cmp_ok(scalar(@rows), "==", $num_expected_rows, "'$word' ($filetype/$dictname)"); 75 70 } 76 71 DoSearch::close_index($index);
