Fix TestPhraseWildcardQuery.testExplain to make it less fragile.

This commit is contained in:
Bruno Roustant 2020-06-10 16:30:25 +02:00
parent 53040984f6
commit 2fe713b348
No known key found for this signature in database
GPG Key ID: CD28DABB95360525
1 changed files with 2 additions and 1 deletions

View File

@ -230,7 +230,8 @@ public class TestPhraseWildcardQuery extends LuceneTestCase {
for (ScoreDoc scoreDoc : searcher.search(testQuery, MAX_DOCS).scoreDocs) {
Explanation explanation = searcher.explain(testQuery, scoreDoc.doc);
assertTrue(explanation.getValue().doubleValue() > 0);
assertEquals("weight(phraseWildcard(title:\"t?e b* b*\") in 1) [AssertingSimilarity], result of:", explanation.getDescription());
assertTrue("Unexpected explanation \"" + explanation.getDescription() + "\"",
explanation.getDescription().startsWith("weight(phraseWildcard(title:\"t?e b* b*\")"));
}
// Verify that if we call PhraseWildcardQuery.PhraseWildcardWeight.scorer() twice,