You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by gg...@apache.org on 2004/06/02 02:55:38 UTC

cvs commit: jakarta-commons/codec/src/test/org/apache/commons/codec/language SoundexTest.java

ggregory    2004/06/01 17:55:38

  Modified:    codec/src/test/org/apache/commons/codec/language
                        SoundexTest.java
  Log:
  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29080
  Throw an exception with a clear message.
  
  Revision  Changes    Path
  1.18      +30 -3     jakarta-commons/codec/src/test/org/apache/commons/codec/language/SoundexTest.java
  
  Index: SoundexTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/codec/src/test/org/apache/commons/codec/language/SoundexTest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SoundexTest.java	19 Apr 2004 01:14:29 -0000	1.17
  +++ SoundexTest.java	2 Jun 2004 00:55:38 -0000	1.18
  @@ -219,8 +219,6 @@
   
       /**
   	 * Test data from http://www.myatt.demon.co.uk/sxalg.htm
  -	 * 
  -	 * @throws EncoderException
   	 */
       public void testEncodeIgnoreHyphens() {
           this.encodeAll(
  @@ -339,4 +337,33 @@
           assertEquals("A500", this.getEncoder().encode("Anne"));
       }
   
  +    /**
  +     * Fancy characters are not mapped by the default US mapping.
  +     * 
  +     * http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29080
  +     */
  +    public void testUsMappingOWithDiaeresis() {
  +        assertEquals("O000", this.getEncoder().encode("o"));
  +        try {
  +            assertEquals("�000", this.getEncoder().encode("�"));
  +            fail("Expected IllegalArgumentException not thrown");
  +        } catch (IllegalArgumentException e) {
  +            // expected
  +        }
  +    }
  +
  +    /**
  +     * Fancy characters are not mapped by the default US mapping.
  +     * 
  +     * http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29080
  +     */
  +    public void testUsMappingEWithAcute() {
  +        assertEquals("E000", this.getEncoder().encode("e"));
  +        try {
  +            assertEquals("�000", this.getEncoder().encode("�"));
  +            fail("Expected IllegalArgumentException not thrown");
  +        } catch (IllegalArgumentException e) {
  +            // expected
  +        }
  +    }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org