You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ba...@apache.org on 2002/07/09 09:39:16 UTC
cvs commit: jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang StringsSubstringTest.java
bayard 2002/07/09 00:39:16
Modified: lang/src/test/org/apache/commons/lang
StringsSubstringTest.java
Log:
Added in a countMatches [counts the number of times a substring matches
on a larger string] tests.
Revision Changes Path
1.3 +10 -1 jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/StringsSubstringTest.java
Index: StringsSubstringTest.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/StringsSubstringTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StringsSubstringTest.java 8 Jul 2002 21:48:30 -0000 1.2
+++ StringsSubstringTest.java 9 Jul 2002 07:39:16 -0000 1.3
@@ -191,4 +191,13 @@
fail();
}
+ public void testCountMatches() {
+ assertEquals(3,
+ Strings.countMatches("one long someone sentence of one", "one"));
+ assertEquals(0,
+ Strings.countMatches("one long someone sentence of one", "two"));
+ assertEquals(4,
+ Strings.countMatches("oooooooooooo", "ooo"));
+ }
+
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>