21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
static OFString *module = @"OFFile";
@implementation TestsAppDelegate (OFFileTests)
- (void)fileTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
TEST(@"+[lastComponentOfPath",
[[OFFile lastComponentOfPath: @"/tmp"] isEqual: @"tmp"] &&
[[OFFile lastComponentOfPath: @"/tmp/"] isEqual: @"tmp"] &&
[[OFFile lastComponentOfPath: @"/"] isEqual: @""] &&
[[OFFile lastComponentOfPath: @"foo"] isEqual: @"foo"] &&
[[OFFile lastComponentOfPath: @"foo/bar"] isEqual: @"bar"] &&
[[OFFile lastComponentOfPath: @"foo/bar/baz/"] isEqual: @"baz"])
[pool drain];
}
@end
|
|
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
static OFString *module = @"OFFile";
@implementation TestsAppDelegate (OFFileTests)
- (void)fileTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
TEST(@"+[lastComponentOfPath]",
[[OFFile lastComponentOfPath: @"/tmp"] isEqual: @"tmp"] &&
[[OFFile lastComponentOfPath: @"/tmp/"] isEqual: @"tmp"] &&
[[OFFile lastComponentOfPath: @"/"] isEqual: @""] &&
[[OFFile lastComponentOfPath: @"foo"] isEqual: @"foo"] &&
[[OFFile lastComponentOfPath: @"foo/bar"] isEqual: @"bar"] &&
[[OFFile lastComponentOfPath: @"foo/bar/baz/"] isEqual: @"baz"])
[pool drain];
}
@end
|