Changeset 2073
- Timestamp:
- 03/10/08 11:15:10 (2 months ago)
- Files:
-
- Swishetest/trunk/t/050-C020-largeindex.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Swishetest/trunk/t/050-C020-largeindex.t
r2053 r2073 6 6 ######################### 7 7 8 # change 'tests => 1' to 'tests => last_test_to_print'; 9 10 use Test::More; # qw(no_plan); # tests => 7; 8 use Test::More; 11 9 use Swishetest; 12 10 use Data::Dumper; … … 19 17 exit(0); 20 18 } 21 plan tests => 3;19 plan tests => 8; 22 20 use File::Path qw(mkpath); 23 21 mkpath( ["blib/index"], 0, 0755); 24 22 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"; 28 25 my (%out) = BuildIndex::build_index_from_external_program( 29 26 27 # index sizes shown are for 2.4 branch on 32bit arch 28 30 29 #"./make_collection -min_words=1000 -max_words=1000 -num_files=100", 31 30 # # this makes 920K of data, 2.33MB index, 476k propfile … … 40 39 # this makes: 3.84G blib/index/T050-28400.index.prop 41 40 # 3.16G blib/index/T050-28400.index 41 # 10K files x 100K words x ~5 chars/word = ~5GB of output 42 42 43 43 "blib/index/$base.index", … … 51 51 52 52 cmp_ok( scalar(keys(%out)), '>', 2, "Indexing output" ); 53 }53 #} 54 54 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 60 63 61 64 DoSearch::open_index( "blib/index/$base.index" ); 62 65 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'" ); 64 68 DoSearch::close_index( "blib/index/$base.index" ); 65 69 cmp_ok(scalar(@rows), '>', 2, "num results from 'swishe OR test'") 66 70 }; 67 71 72
