Made joinEscaped() handle null array elements by converting them to the

empty string.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@550 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2002-01-30 18:21:15 +00:00
parent a7eef89a75
commit 2fb0906dda
2 changed files with 11 additions and 4 deletions
@@ -1,5 +1,5 @@
//
// $Id: StringUtilTest.java,v 1.1 2002/01/30 18:11:27 mdb Exp $
// $Id: StringUtilTest.java,v 1.2 2002/01/30 18:21:15 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -43,6 +43,11 @@ public class StringUtilTest extends TestCase
// now join them back together
String joined = StringUtil.joinEscaped(tokens);
assert("joined.equals(source)", joined.equals(source));
// make sure null to empty string works
tokens = new String[] { "this", null, "is", null, "a", null, "test" };
joined = StringUtil.joinEscaped(tokens);
assert("null elements work", joined.equals("this, , is, , a, , test"));
}
public static Test suite ()