[Nice-commit] Nice/testsuite/lib/nice/lang strings.testsuite,1.2,1.3
Brought to you by:
bonniot
From: <bo...@us...> - 2004-02-28 14:10:24
|
Update of /cvsroot/nice/Nice/testsuite/lib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12437 Modified Files: strings.testsuite Log Message: Modified split to use a character separator. JDK 1.4 includes a String.split(String), where the second argument is a regexp. It's not necessary to duplicate that functionality, but spliting based on a single character is a useful special case. Index: strings.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/lib/nice/lang/strings.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** strings.testsuite 3 Jun 2003 19:12:52 -0000 1.2 --- strings.testsuite 28 Feb 2004 14:00:54 -0000 1.3 *************** *** 1,4 **** /// PASS ! List<String> splits = split("foo,bar,baz", ","); assert splits.size == 3; assert splits[0].equals("foo"); --- 1,4 ---- /// PASS ! List<String> splits = split("foo,bar,baz", ','); assert splits.size == 3; assert splits[0].equals("foo"); *************** *** 7,16 **** /// PASS - List<String> splits = split("foo,bar,foo,baz", "foo,"); - assert splits.size == 2; - assert splits[0].equals("bar,"); - assert splits[1].equals("baz"); - - /// PASS String joined = ["1", "2", "3"].join(","); assert joined.equals("1,2,3"); --- 7,10 ---- |