remove timeout dependency from TestHunspell.testSuggestionOrderStabilityOnDictionaryEditing

This commit is contained in:
Peter Gromov 2023-04-23 21:16:56 +02:00
parent 025dfec2dd
commit 5e0761eab5
1 changed files with 6 additions and 3 deletions

View File

@ -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);
}