commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djo...@apache.org
Subject [lang] Improve test coverage of utility method.
Date Sun, 18 Dec 2016 10:50:52 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 600eb9eb9 -> 363cbf790


Improve test coverage of utility method.

Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/363cbf79
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/363cbf79
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/363cbf79

Branch: refs/heads/master
Commit: 363cbf7908cfcc6a538126bcccf5c955afda6aa1
Parents: 600eb9e
Author: duncan <duncan@wortharead.com>
Authored: Sun Dec 18 10:49:25 2016 +0000
Committer: duncan <duncan@wortharead.com>
Committed: Sun Dec 18 10:49:25 2016 +0000

----------------------------------------------------------------------
 .../apache/commons/lang3/CharSequenceUtilsTest.java   | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/363cbf79/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java b/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
index 30e992c..6ab9aae 100644
--- a/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/CharSequenceUtilsTest.java
@@ -16,10 +16,7 @@
  */
 package org.apache.commons.lang3;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
@@ -182,5 +179,14 @@ public class CharSequenceUtilsTest {
             }.run(data, "CSNonString");
         }
     }
+    
+    
+    @Test
+    public void testToCharArray() throws Exception {
+        final StringBuilder builder = new StringBuilder("abcdefg");
+        final char[] expected = builder.toString().toCharArray();
+        assertArrayEquals(expected, CharSequenceUtils.toCharArray(builder));
+        assertArrayEquals(expected, CharSequenceUtils.toCharArray(builder.toString()));
+    }
 
 }


Mime
View raw message