add unit test for StringUtil#join
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1739660 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
556f1e78a1
commit
ba64b65412
@ -184,5 +184,13 @@ public class TestStringUtil {
|
|||||||
assertFalse("trailing whitespace should not be ignored", StringUtil.endsWithIgnoreCase("Apache POI project ", "Apache POI"));
|
assertFalse("trailing whitespace should not be ignored", StringUtil.endsWithIgnoreCase("Apache POI project ", "Apache POI"));
|
||||||
assertFalse("shorter string", StringUtil.endsWithIgnoreCase("Apache", "Apache POI"));
|
assertFalse("shorter string", StringUtil.endsWithIgnoreCase("Apache", "Apache POI"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void join() {
|
||||||
|
assertEquals("", StringUtil.join(",")); // degenerate case: nothing to join
|
||||||
|
assertEquals("abc", StringUtil.join(",", "abc")); // degenerate case: one thing to join, no trailing comma
|
||||||
|
assertEquals("abc|def|ghi", StringUtil.join("|", "abc", "def", "ghi"));
|
||||||
|
assertEquals("5|8.5|true|string", StringUtil.join("|", 5, 8.5, true, "string")); //assumes Locale prints number decimal point as a period rather than a comma
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user