diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-08-01 11:43:41 -0500 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-08-03 20:04:29 +0000 |
commit | 0aa5baa369e8ecced14773ae62dc14ec305ee1b9 (patch) | |
tree | 77bbb01736cdcb88f1fd0201fff60ee150a8311b /t | |
parent | 1597d1a5fff6c1090cc65f439d1773cb3e98d382 (diff) | |
download | public-inbox-0aa5baa369e8ecced14773ae62dc14ec305ee1b9.tar.gz |
Instrument the tests to verify the highwater num highwater mark is where it is expected. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 't')
-rw-r--r-- | t/v1reindex.t | 10 | ||||
-rw-r--r-- | t/v2reindex.t | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/t/v1reindex.t b/t/v1reindex.t index 876c9db3..8be95149 100644 --- a/t/v1reindex.t +++ b/t/v1reindex.t @@ -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'); } diff --git a/t/v2reindex.t b/t/v2reindex.t index 3d217aff..a5454a22 100644 --- a/t/v2reindex.t +++ b/t/v2reindex.t @@ -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 $_ } |