Better unit test code coverage.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@226713 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2005-08-01 01:21:29 +00:00
parent 2b6e554ccf
commit 020480ad81
1 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,8 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import org.apache.commons.lang.ArrayUtils;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestCase; import junit.framework.TestCase;
import junit.framework.TestSuite; import junit.framework.TestSuite;
@ -1071,6 +1073,7 @@ public class StrBuilderTest extends TestCase {
public void testToCharArray ( ) { public void testToCharArray ( ) {
StrBuilder sb = new StrBuilder(); StrBuilder sb = new StrBuilder();
assertEquals(ArrayUtils.EMPTY_CHAR_ARRAY, sb.toCharArray());
char[] a = sb.toCharArray(); char[] a = sb.toCharArray();
assertNotNull ("toCharArray() result is null", a); assertNotNull ("toCharArray() result is null", a);
@ -1084,6 +1087,8 @@ public class StrBuilderTest extends TestCase {
public void testToCharArrayIntInt() { public void testToCharArrayIntInt() {
StrBuilder sb = new StrBuilder(); StrBuilder sb = new StrBuilder();
assertEquals(ArrayUtils.EMPTY_CHAR_ARRAY, sb.toCharArray(0, 0));
sb.append("junit"); sb.append("junit");
char[] a = sb.toCharArray(0, 20); //too large test char[] a = sb.toCharArray(0, 20); //too large test
assertEquals ("toCharArray(int,int) result incorrect length",5, a.length); assertEquals ("toCharArray(int,int) result incorrect length",5, a.length);