]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/v[12]reindex.t: Verify the num highwater is as expected
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 1 Aug 2018 16:43:41 +0000 (11:43 -0500)
committerEric Wong <e@80x24.org>
Fri, 3 Aug 2018 20:04:29 +0000 (20:04 +0000)
Instrument the tests to verify the highwater num highwater mark is
where it is expected.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
t/v1reindex.t
t/v2reindex.t

index 876c9db3441aee0f341ce28ec5554ab5414aed8a..8be95149723c1539ef252c72147b6da739e4e287 100644 (file)
@@ -63,6 +63,7 @@ my ($mark1, $mark2, $mark3, $mark4);
        $minmax = [ $ibx->mm->minmax ];
        ok(defined $minmax->[0] && defined $minmax->[1], 'minmax defined');
        is_deeply($minmax, [ 1, 10 ], 'minmax as expected');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = @$minmax;
        $msgmap = $ibx->mm->msg_range(\$min, $max);
@@ -87,6 +88,8 @@ my ($mark1, $mark2, $mark3, $mark4);
        is($@, '', 'no error from reindexing');
        $im->done;
 
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
+
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
@@ -107,6 +110,7 @@ ok(!-d $xap, 'Xapian directories removed');
 
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
@@ -129,6 +133,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
@@ -151,6 +156,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = @$minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
@@ -174,6 +180,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
        my $mset = $ibx->search->query('hello world', {mset=>1});
        isnt($mset->size, 0, 'got Xapian search results');
 
@@ -199,6 +206,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
        my $mset = $ibx->search->reopen->query('hello world', {mset=>1});
        is($mset->size, 0, "no Xapian search results");
 
@@ -223,6 +231,8 @@ ok(!-d $xap, 'Xapian directories removed again');
        my $mset = $ibx->search->reopen->query('hello world', {mset=>1});
        isnt($mset->size, 0, 'search OK after basic -> medium');
 
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
+
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
index 3d217aff3c72067f8d57f3c87d7a569efd0a82b1..a5454a22abf58dd929adff066e9099df775735c4 100644 (file)
@@ -60,6 +60,7 @@ my ($mark1, $mark2, $mark3, $mark4);
        $minmax = [ $ibx->mm->minmax ];
        ok(defined $minmax->[0] && defined $minmax->[1], 'minmax defined');
        is_deeply($minmax, [ 1, 10 ], 'minmax as expected');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = @$minmax;
        $msgmap = $ibx->mm->msg_range(\$min, $max);
@@ -85,6 +86,7 @@ my ($mark1, $mark2, $mark3, $mark4);
 
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
@@ -104,6 +106,7 @@ ok(!-d $xap, 'Xapian directories removed');
 
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
@@ -125,6 +128,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        my ($min, $max) = $ibx->mm->minmax;
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
@@ -147,6 +151,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
        my $mset = $ibx->search->query('"hello world"', {mset=>1});
        isnt($mset->size, 0, "phrase search succeeds on indexlevel=full");
        for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ }
@@ -172,6 +177,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
 
        if (0) {
                # not sure why, but Xapian seems to fallback to terms and
@@ -208,6 +214,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        ok(-d $xap, 'Xapian directories recreated');
        delete $ibx->{mm};
        is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged');
+       is($ibx->mm->num_highwater, 10, 'num_highwater as expected');
        my $mset = $ibx->search->query('hello', {mset=>1});
        is($mset->size, 0, "search fails on indexlevel='basic'");
        for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ }