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:17:08 UTC
[lucene] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new 5e0761eab51 remove timeout dependency from TestHunspell.testSuggestionOrderStabilityOnDictionaryEditing
5e0761eab51 is described below
commit 5e0761eab510f695806fdc3b51d0e9ea85497a34
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 f7170bc80e2..d7bf91f8c21 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
@@ -166,7 +166,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, () -> {});
}
@@ -265,8 +268,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);
}