make sure the simple tests run against both cases

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1459155 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-03-21 05:25:58 +00:00
parent 734c426fa7
commit 865982dbe3
1 changed files with 10 additions and 0 deletions

View File

@ -86,12 +86,22 @@ public class TestBooleanMinShouldMatch extends LuceneTestCase {
public void verifyNrHits(Query q, int expected) throws Exception {
// bs1
ScoreDoc[] h = s.search(q, null, 1000).scoreDocs;
if (expected != h.length) {
printHits(getTestName(), h, s);
}
assertEquals("result count", expected, h.length);
//System.out.println("TEST: now check");
// bs2
TopScoreDocCollector collector = TopScoreDocCollector.create(1000, true);
s.search(q, collector);
ScoreDoc[] h2 = collector.topDocs().scoreDocs;
if (expected != h2.length) {
printHits(getTestName(), h2, s);
}
assertEquals("result count (bs2)", expected, h2.length);
QueryUtils.check(random(), q,s);
}