Changeset 2073

Show
Ignore:
Timestamp:
03/10/08 11:15:10 (2 months ago)
Author:
joshr
Message:

more tests and comments.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Swishetest/trunk/t/050-C020-largeindex.t

    r2053 r2073  
    66######################### 
    77 
    8 # change 'tests => 1' to 'tests => last_test_to_print'; 
    9  
    10 use Test::More; # qw(no_plan); # tests => 7; 
     8use Test::More;  
    119use Swishetest; 
    1210use Data::Dumper; 
     
    1917        exit(0); 
    2018    } 
    21     plan tests => 3
     19    plan tests => 8
    2220    use File::Path qw(mkpath); 
    2321    mkpath( ["blib/index"], 0, 0755); 
    2422    my $base = "T050-$$";  # test 050 
    25     #my $base = "T050-28400";  # test 050 
    26     unless (-e "blib/index/$base.index" ) { 
    27         warn "base is $base\n"; 
     23    #unless (-e "blib/index/$base.index" ) { 
     24        #warn "base is $base\n"; 
    2825        my (%out) = BuildIndex::build_index_from_external_program(  
    2926 
     27            # index sizes shown are for 2.4 branch on 32bit arch 
     28                 
    3029            #"./make_collection -min_words=1000    -max_words=1000    -num_files=100",  
    3130            #      # this makes 920K of data, 2.33MB index, 476k propfile 
     
    4039             # this makes: 3.84G    blib/index/T050-28400.index.prop 
    4140             #             3.16G    blib/index/T050-28400.index 
     41             #      10K files x 100K words x ~5 chars/word = ~5GB of output 
    4242              
    4343            "blib/index/$base.index", 
     
    5151     
    5252        cmp_ok( scalar(keys(%out)), '>',          2, "Indexing output" );  
    53    
     53        #
    5454 
    55     #cmp_ok( $out{unique},     '==',    252983, 'unique words indexed' ); 
    56     #cmp_ok( $out{properties}, '==',         5, 'num properties' ); 
    57     #cmp_ok( $out{files},      '==',         2, 'files indexed' ); 
    58     #cmp_ok( $out{bytes},      '==',   2896130, 'bytes indexed' ); 
    59     #cmp_ok( $out{words},      '==',    280381, 'total words indexed' ); 
     55    cmp_ok( $out{unique},     '==',    45_398, 'unique words indexed' ); 
     56    cmp_ok( $out{properties}, '==',         5, 'num properties' ); 
     57    cmp_ok( $out{files},      '==',    10_000, 'files indexed' ); 
     58    cmp_ok( $out{bytes},      '==',  5_000_000_000 'bytes indexed' );          # ~5GB indexed 
     59    #cmp_ok( $out{bytes},      '==',  420_526_223, 'bytes indexed' );          # 420Megs indexed 
     60                                                                            # THIS is wrong.  
     61                                                                            # Should be more like 5GB 
     62    cmp_ok( $out{words},      '==',    1_000_000_000, 'total words indexed' );  # one billion words 
    6063 
    6164    DoSearch::open_index( "blib/index/$base.index" ); 
    6265    ok( 1, "index opened" ); 
    63     my @rows = DoSearch::do_search( "blib/index/$base.index", "swishe OR test"); 
     66    my @rows = DoSearch::do_search( "blib/index/$base.index", "dog OR test"); 
     67    cmp_ok( scalar(@rows), '>', 0, "searched for 'dog OR test'" ); 
    6468    DoSearch::close_index( "blib/index/$base.index" ); 
    6569    cmp_ok(scalar(@rows), '>', 2, "num results from 'swishe OR test'")  
    6670}; 
    6771 
     72