You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by do...@apache.org on 2023/04/23 19:57:35 UTC

[lucene] branch branch_9x updated: remove timeout dependency from TestHunspell.testSuggestionOrderStabilityOnDictionaryEditing

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

donnerpeter pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new f517a795ec9 remove timeout dependency from TestHunspell.testSuggestionOrderStabilityOnDictionaryEditing
f517a795ec9 is described below

commit f517a795ec92f47f57c6fb631bb130c706356ebe
Author: Peter Gromov <pe...@jetbrains.com>
AuthorDate: Sun Apr 23 21:16:56 2023 +0200

    remove timeout dependency from TestHunspell.testSuggestionOrderStabilityOnDictionaryEditing
---
 .../test/org/apache/lucene/analysis/hunspell/TestHunspell.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java
index f4b8cc7f917..e160cd7851c 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java
@@ -170,7 +170,10 @@ public class TestHunspell extends LuceneTestCase {
   }
 
   private Hunspell loadNoTimeout(String name) throws Exception {
-    Dictionary dictionary = loadDictionary(false, name + ".aff", name + ".dic");
+    return loadNoTimeout(loadDictionary(false, name + ".aff", name + ".dic"));
+  }
+
+  private static Hunspell loadNoTimeout(Dictionary dictionary) {
     return new Hunspell(dictionary, TimeoutPolicy.NO_TIMEOUT, () -> {});
   }
 
@@ -269,8 +272,8 @@ public class TestHunspell extends LuceneTestCase {
 
     assertFalse(new Hunspell(small).spell(original));
 
-    List<String> smallSug = new Hunspell(small).suggest(original);
-    List<String> largerSug = new Hunspell(larger).suggest(original);
+    List<String> smallSug = loadNoTimeout(small).suggest(original);
+    List<String> largerSug = loadNoTimeout(larger).suggest(original);
     assertEquals(smallSug.toString(), 4, smallSug.size());
     assertEquals(smallSug, largerSug);
   }