CPArrayTest

This commit is contained in:
Tom Robinson committed 2008-10-05 18:47:47 -07:00
1 parent ba189afaf5
commit 02b4187742
1 file changed
+21
+21
View File
@@ -0,0 +1,21 @@
import <Foundation/CPArray.j>
import <Foundation/CPString.j>
import <Foundation/CPNumber.j>
@implementation CPArrayTest : OJTestCase
- (void)testComponentsJoinedByString
{
var testStrings = [
[[], "", ""],
[[], "-", ""],
[[1,2], "-", "1-2"],
[[1,2,3], "-", "1-2-3"],
[["123", 456], "-", "123-456"]
];
for (var i = 0; i < testStrings.length; i++)
[self assert:[testStrings[i][0] componentsJoinedByString:testStrings[i][1]] equals:testStrings[i][2]];
}
@end