You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by br...@apache.org on 2020/06/10 16:35:23 UTC

[lucene-solr] branch branch_8x updated: Fix TestPhraseWildcardQuery.testExplain to make it less fragile.

This is an automated email from the ASF dual-hosted git repository.

broustant pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 23cf508  Fix TestPhraseWildcardQuery.testExplain to make it less fragile.
23cf508 is described below

commit 23cf5082ae18418d8073bf5cc90162aff44445ee
Author: Bruno Roustant <br...@salesforce.com>
AuthorDate: Wed Jun 10 16:30:25 2020 +0200

    Fix TestPhraseWildcardQuery.testExplain to make it less fragile.
---
 .../src/test/org/apache/lucene/search/TestPhraseWildcardQuery.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/TestPhraseWildcardQuery.java b/lucene/sandbox/src/test/org/apache/lucene/search/TestPhraseWildcardQuery.java
index 91ec32e..c8d9d51 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/search/TestPhraseWildcardQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/search/TestPhraseWildcardQuery.java
@@ -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,