[34715][lang] unit test for org.apache.commons.lang.text.StrBuilder.

Patch applied, thanks.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@219083 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2005-07-14 19:52:31 +00:00
parent 421ba4c94c
commit 44334fdc98
2 changed files with 7 additions and 5 deletions

View File

@ -589,10 +589,11 @@ public class StrBuilder implements Cloneable {
if (coll != null && coll.size() > 0) {
separator = (separator == null ? "" : separator);
Iterator it = coll.iterator();
append(it.next());
while (it.hasNext()) {
append(separator);
append(it.next());
if (it.hasNext()) {
append(separator);
}
}
}
return this;
@ -611,10 +612,11 @@ public class StrBuilder implements Cloneable {
public StrBuilder appendWithSeparators(Iterator it, String separator) {
if (it != null) {
separator = (separator == null ? "" : separator);
append(it.next());
while (it.hasNext()) {
append(separator);
append(it.next());
if (it.hasNext()) {
append(separator);
}
}
}
return this;

View File

@ -567,7 +567,7 @@ public class StrBuilderTest extends TestCase {
sb.clear();
sb.setNullText("null");
sb.appendFixedWidthPadRight(null, 5, '-');
sb.appendFixedWidthPadLeft(null, 5, '-');
assertEquals("-null", sb.toString());
}