commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang StringUtilsTest.java
Date Wed, 29 Oct 2003 01:50:15 GMT
ggregory    2003/10/28 17:50:15

  Modified:    lang/src/test/org/apache/commons/lang StringUtilsTest.java
  Log:
  Added  public static String removeStart(String str, String remove).
  
  Revision  Changes    Path
  1.53      +18 -1     jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTest.java
  
  Index: StringUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTest.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- StringUtilsTest.java	21 Aug 2003 22:13:24 -0000	1.52
  +++ StringUtilsTest.java	29 Oct 2003 01:50:14 -0000	1.53
  @@ -986,5 +986,22 @@
           assertNotNull(StringUtils.EMPTY);
           assertEquals("", StringUtils.EMPTY);
       }
  +    
  +    public void testRemoveStart() {
  +        // StringUtils.removeStart("", *)        = ""
  +        assertNull(StringUtils.removeStart(null, null));
  +        assertNull(StringUtils.removeStart(null, ""));
  +        assertNull(StringUtils.removeStart(null, "a"));
  +        
  +        // StringUtils.removeStart(*, null)      = *
  +        assertEquals(StringUtils.removeStart("", null), "");
  +        assertEquals(StringUtils.removeStart("", ""), "");
  +        assertEquals(StringUtils.removeStart("", "a"), "");
  +        
  +        // All others:
  +        assertEquals(StringUtils.removeStart("www.domain.com", "www."), "domain.com");
  +        assertEquals(StringUtils.removeStart("domain.com", "www."), "domain.com");
  +        assertEquals(StringUtils.removeStart("domain.com", ""), "domain.com");        
  +    }
   }
   
  
  
  

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


Mime
View raw message