fix very rare test bug that I somehow hit

This commit is contained in:
Mike McCandless 2016-03-05 04:57:14 -05:00
parent 9c8cbefbff
commit f1c044a2d7
1 changed files with 4 additions and 1 deletions

View File

@ -421,7 +421,10 @@ public class TestRangeFacetCounts extends FacetTestCase {
} }
boolean minIncl; boolean minIncl;
boolean maxIncl; boolean maxIncl;
if (min == max) {
// NOTE: max - min >= 0 is here to handle the common overflow case!
if (max - min >= 0 && max - min < 2) {
// If max == min or max == min+1, we always do inclusive, else we might pass an empty range and hit exc from LongRange's ctor:
minIncl = true; minIncl = true;
maxIncl = true; maxIncl = true;
} else { } else {