diff options
author | Javen O'Neal <onealj@apache.org> | 2016-04-17 21:28:49 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-04-17 21:28:49 +0000 |
commit | d43c3993fbcc908f8207791c0a80990a5b0746af (patch) | |
tree | 21f33a84b11d55b2843f5c68d8a233cb31ab38d7 /src/testcases/org/apache/poi/util | |
parent | 981ebf6f5e354285797d6095a6fdd5bdda16cbd3 (diff) | |
download | poi-d43c3993fbcc908f8207791c0a80990a5b0746af.tar.gz poi-d43c3993fbcc908f8207791c0a80990a5b0746af.zip |
add unit test for StringUtil#join
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1739660 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/util')
-rw-r--r-- | src/testcases/org/apache/poi/util/TestStringUtil.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/util/TestStringUtil.java b/src/testcases/org/apache/poi/util/TestStringUtil.java index 0134ff0f71..002c8dcd2d 100644 --- a/src/testcases/org/apache/poi/util/TestStringUtil.java +++ b/src/testcases/org/apache/poi/util/TestStringUtil.java @@ -184,5 +184,13 @@ public class TestStringUtil { assertFalse("trailing whitespace should not be ignored", StringUtil.endsWithIgnoreCase("Apache POI project ", "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 + } } |