Skip to content

Commit c50e096

Browse files
committed
Modified the test to expect an empty string if the 'fancy' character passed in is not considered a letter by the JVM. See Issue CODEC-51
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@476031 13f79535-47bb-0310-9956-ffa450edef68
1 parent 81d3e3d commit c50e096

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

src/test/org/apache/commons/codec/language/SoundexTest.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,15 @@ public void testMsSqlServer3() {
345345
*/
346346
public void testUsMappingOWithDiaeresis() {
347347
assertEquals("O000", this.getEncoder().encode("o"));
348-
try {
349-
assertEquals("Ö000", this.getEncoder().encode("ö"));
350-
fail("Expected IllegalArgumentException not thrown");
351-
} catch (IllegalArgumentException e) {
352-
// expected
348+
if ( Character.isLetter('ö') ) {
349+
try {
350+
assertEquals("Ö000", this.getEncoder().encode("ö"));
351+
fail("Expected IllegalArgumentException not thrown");
352+
} catch (IllegalArgumentException e) {
353+
// expected
354+
}
355+
} else {
356+
assertEquals("", this.getEncoder().encode("ö"));
353357
}
354358
}
355359

@@ -360,11 +364,15 @@ public void testUsMappingOWithDiaeresis() {
360364
*/
361365
public void testUsMappingEWithAcute() {
362366
assertEquals("E000", this.getEncoder().encode("e"));
363-
try {
364-
assertEquals("É000", this.getEncoder().encode("é"));
365-
fail("Expected IllegalArgumentException not thrown");
366-
} catch (IllegalArgumentException e) {
367-
// expected
367+
if ( Character.isLetter('é') ) {
368+
try {
369+
assertEquals("É000", this.getEncoder().encode("é"));
370+
fail("Expected IllegalArgumentException not thrown");
371+
} catch (IllegalArgumentException e) {
372+
// expected
373+
}
374+
} else {
375+
assertEquals("", this.getEncoder().encode("é"));
368376
}
369377
}
370378

0 commit comments

Comments
 (0)