LUCENE-8686: Fix test bug in TestTaxonomyFacetSumValueSource#testRandom

This commit is contained in:
jimczi 2019-02-21 16:36:26 +09:00
parent 6e81def01c
commit 4625270ce0
1 changed files with 4 additions and 2 deletions

View File

@ -452,8 +452,10 @@ public class TestTaxonomyFacetSumValueSource extends FacetTestCase {
List<LabelAndValue> labelValues = new ArrayList<>();
double totValue = 0;
for(Map.Entry<String,Float> ent : expectedValues[i].entrySet()) {
labelValues.add(new LabelAndValue(ent.getKey(), ent.getValue()));
totValue += ent.getValue();
if (ent.getValue() > 0) {
labelValues.add(new LabelAndValue(ent.getKey(), ent.getValue()));
totValue += ent.getValue();
}
}
sortLabelValues(labelValues);
if (totValue > 0) {