This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
The following commit(s) were added to refs/heads/master by this push:
new ed943155 Use longer lines
ed943155 is described below
commit ed9431550e8dc485073d3648c9435b43ee0b2e8b
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sun Jul 6 14:25:25 2025 -0400
Use longer lines
Reduce vertical whitespace
---
.../org/apache/commons/codec/language/bm/RuleTest.java | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/src/test/java/org/apache/commons/codec/language/bm/RuleTest.java
b/src/test/java/org/apache/commons/codec/language/bm/RuleTest.java
index 8baae4c4..88b088d9 100644
--- a/src/test/java/org/apache/commons/codec/language/bm/RuleTest.java
+++ b/src/test/java/org/apache/commons/codec/language/bm/RuleTest.java
@@ -26,12 +26,11 @@ import org.junit.jupiter.api.Test;
* Tests Rule.
*/
class RuleTest {
+
private Rule.Phoneme[][] makePhonemes() {
- final String[][] words = {
- { "rinD", "rinDlt", "rina", "rinalt", "rino", "rinolt",
"rinu", "rinult" },
+ final String[][] words = { { "rinD", "rinDlt", "rina", "rinalt",
"rino", "rinolt", "rinu", "rinult" },
{ "dortlaj", "dortlej", "ortlaj", "ortlej", "ortlej-dortlaj" }
};
final Rule.Phoneme[][] phonemes = new Rule.Phoneme[words.length][];
-
for (int i = 0; i < words.length; i++) {
final String[] words_i = words[i];
final Rule.Phoneme[] phonemes_i = phonemes[i] = new
Rule.Phoneme[words_i.length];
@@ -39,7 +38,6 @@ class RuleTest {
phonemes_i[j] = new Rule.Phoneme(words_i[j],
Languages.NO_LANGUAGES);
}
}
-
return phonemes;
}
@@ -49,7 +47,6 @@ class RuleTest {
for (int i = 0; i < phs.length; i++) {
for (int j = i + 1; j < phs.length; j++) {
final int c = Rule.Phoneme.COMPARATOR.compare(phs[i],
phs[j]);
-
assertTrue(Integer.valueOf(c).intValue() < 0,
"Comparing " + phs[i].getPhonemeText() + " to " +
phs[j].getPhonemeText() + " should be negative");
}
@@ -61,8 +58,7 @@ class RuleTest {
void testPhonemeComparedToSelfIsZero() {
for (final Rule.Phoneme[] phs : makePhonemes()) {
for (final Rule.Phoneme ph : phs) {
- assertEquals(0, Rule.Phoneme.COMPARATOR.compare(ph, ph),
- "Phoneme compared to itself should be zero: " +
ph.getPhonemeText());
+ assertEquals(0, Rule.Phoneme.COMPARATOR.compare(ph, ph),
"Phoneme compared to itself should be zero: " + ph.getPhonemeText());
}
}
}
@@ -70,14 +66,12 @@ class RuleTest {
@Test
void testSubSequenceWorks() {
// AppendableCharSequence is private to Rule. We can only make it
through a Phoneme.
-
final Rule.Phoneme a = new Rule.Phoneme("a", null);
final Rule.Phoneme b = new Rule.Phoneme("b", null);
final Rule.Phoneme cd = new Rule.Phoneme("cd", null);
final Rule.Phoneme ef = new Rule.Phoneme("ef", null);
final Rule.Phoneme ghi = new Rule.Phoneme("ghi", null);
final Rule.Phoneme jkl = new Rule.Phoneme("jkl", null);
-
assertEquals('a', a.getPhonemeText().charAt(0));
assertEquals('b', b.getPhonemeText().charAt(0));
assertEquals('c', cd.getPhonemeText().charAt(0));
@@ -90,14 +84,12 @@ class RuleTest {
assertEquals('j', jkl.getPhonemeText().charAt(0));
assertEquals('k', jkl.getPhonemeText().charAt(1));
assertEquals('l', jkl.getPhonemeText().charAt(2));
-
final Rule.Phoneme a_b = new Rule.Phoneme(a, b);
assertEquals('a', a_b.getPhonemeText().charAt(0));
assertEquals('b', a_b.getPhonemeText().charAt(1));
assertEquals("ab", a_b.getPhonemeText().subSequence(0, 2).toString());
assertEquals("a", a_b.getPhonemeText().subSequence(0, 1).toString());
assertEquals("b", a_b.getPhonemeText().subSequence(1, 2).toString());
-
final Rule.Phoneme cd_ef = new Rule.Phoneme(cd, ef);
assertEquals('c', cd_ef.getPhonemeText().charAt(0));
assertEquals('d', cd_ef.getPhonemeText().charAt(1));
@@ -113,7 +105,6 @@ class RuleTest {
assertEquals("cde", cd_ef.getPhonemeText().subSequence(0,
3).toString());
assertEquals("def", cd_ef.getPhonemeText().subSequence(1,
4).toString());
assertEquals("cdef", cd_ef.getPhonemeText().subSequence(0,
4).toString());
-
final Rule.Phoneme a_b_cd = new Rule.Phoneme(new Rule.Phoneme(a, b),
cd);
assertEquals('a', a_b_cd.getPhonemeText().charAt(0));
assertEquals('b', a_b_cd.getPhonemeText().charAt(1));